Github user jamesreggio commented on a diff in the pull request:
https://github.com/apache/thrift/pull/986#discussion_r59645250
--- Diff: lib/nodejs/lib/thrift/connection.js ---
@@ -81,15 +81,7 @@ var Connection = exports.Connection = function(stream,
options) {
});
this.connection.addListener("error", function(err) {
- // Only emit the error if no-one else is listening on the connection
- // or if someone is listening on us
- if (self.connection.listeners('error').length === 1 ||
- self.listeners('error').length > 0) {
- self.emit("error", err);
- }
- // "error" events get turned into exceptions if they aren't listened
for. If the user handled this error
- // then we should try to reconnect.
- self.connection_gone();
--- End diff --
Per [Node.js
documentation](https://nodejs.org/api/net.html#net_event_error_1), `error` is
always followed by `close`, so there's no need to call `connection_gone()`
twice.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---