THRIFT-2390: no close event when connection lost
authorjfarrell <jfarrell@apache.org>
Tue, 18 Mar 2014 13:24:34 +0000 (09:24 -0400)
committerjfarrell <jfarrell@apache.org>
Tue, 18 Mar 2014 13:24:34 +0000 (09:24 -0400)
Client: node
Patch: gruzovator <gruzovator@gmail.com>

Github Pull Request: This closes #83
----
commit 270183f0507afc4346486cb58b8a684174eb13db
Author: gruzovator <gruzovator@gmail.com>
Date:   2014-03-18T12:23:21Z

    fix for THRIFT-2390

    fix for THRIFT-2390 (no close event when connection lost)

lib/nodejs/lib/thrift/connection.js

index fb9215f..36451d5 100644 (file)
@@ -168,9 +168,13 @@ Connection.prototype.connection_gone = function () {
   var self = this;
 
   // If a retry is already in progress, just let that happen
-  if (this.retry_timer || !this.max_attempts) {
+  if (this.retry_timer) {
         return;
   }
+  if (!this.max_attempts) {
+    self.emit("close");
+    return;
+  }
 
   this.connected = false;
   this.ready = false;