You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem that accrues sporadically, I'm working on top of unstable servers (not my choice), that means that every once in a while all the connections get disconnected.
When that happens it looks like the driver doesn't reacts well:
stack:
[ 'TypeError: listener must be a function',
' at TypeError ()',
' at Connection.EventEmitter.removeListener (events.js:195:11)',
' at Query._removeAllListeners (/opt/Autonomy/shared/vertica-util/node_modules/vertica/lib/query.js:241:21)',
' at Query.onConnectionError (/opt/Autonomy/shared/vertica-util/node_modules/vertica/lib/query.js:130:10)',
' at Connection._onClose (/opt/Autonomy/shared/vertica-util/node_modules/vertica/lib/connection.js:364:23)',
' at Socket.g (events.js:180:16)',
' at Socket.EventEmitter.emit (events.js:95:17)',
' at TCP.close (net.js:465:12)' ] }
I looked at the code and it looks like a this problem:
you are trying to remove a listener:
this.connection.removeListener('EmptyQueryResponse', this.onEmptyQueryListener);
That we added in the run function:
Query.prototype.run = function() {
this.emit('start');
this.connection._writeMessage(new FrontendMessage.Query(this.sql));
this.connection.once('EmptyQueryResponse', this.onEmptyQueryListener = this.onEmptyQuery.bind(this));
which is declared on the Query:
Query.prototype.onEmptyQuery = function(msg) {
var err;
err = new errors.QueryError("The query was empty!");
if (this.callback) {
return this.error = err;
} else {
return this.emit('error', err);
}
};
Could it have something to do with the clients code?
Do you have a workaround?
Thanks.
The text was updated successfully, but these errors were encountered:
The error handler will try to deregister the event listeners, but they have not been set yet.
The solution would be to only unregister the listeners if they are set only. I don't have a working node.js or vertica setup available right now, so it's unlikely I will fix this myself any time soon. I will gladly accept patches for this though.
I have a problem that accrues sporadically, I'm working on top of unstable servers (not my choice), that means that every once in a while all the connections get disconnected.
When that happens it looks like the driver doesn't reacts well:
stack:
[ 'TypeError: listener must be a function',
' at TypeError ()',
' at Connection.EventEmitter.removeListener (events.js:195:11)',
' at Query._removeAllListeners (/opt/Autonomy/shared/vertica-util/node_modules/vertica/lib/query.js:241:21)',
' at Query.onConnectionError (/opt/Autonomy/shared/vertica-util/node_modules/vertica/lib/query.js:130:10)',
' at Connection._onClose (/opt/Autonomy/shared/vertica-util/node_modules/vertica/lib/connection.js:364:23)',
' at Socket.g (events.js:180:16)',
' at Socket.EventEmitter.emit (events.js:95:17)',
' at TCP.close (net.js:465:12)' ] }
I looked at the code and it looks like a this problem:
you are trying to remove a listener:
this.connection.removeListener('EmptyQueryResponse', this.onEmptyQueryListener);
That we added in the run function:
Query.prototype.run = function() {
this.emit('start');
this.connection._writeMessage(new FrontendMessage.Query(this.sql));
this.connection.once('EmptyQueryResponse', this.onEmptyQueryListener = this.onEmptyQuery.bind(this));
which is declared on the Query:
Query.prototype.onEmptyQuery = function(msg) {
var err;
err = new errors.QueryError("The query was empty!");
if (this.callback) {
return this.error = err;
} else {
return this.emit('error', err);
}
};
Could it have something to do with the clients code?
Do you have a workaround?
Thanks.
The text was updated successfully, but these errors were encountered: