From 270183f0507afc4346486cb58b8a684174eb13db Mon Sep 17 00:00:00 2001 From: gruzovator Date: Tue, 18 Mar 2014 15:23:21 +0300 Subject: [PATCH] fix for THRIFT-2390 fix for THRIFT-2390 (no close event when connection lost) --- lib/nodejs/lib/thrift/connection.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/nodejs/lib/thrift/connection.js b/lib/nodejs/lib/thrift/connection.js index fb9215f2f9e..14a5d798031 100644 --- a/lib/nodejs/lib/thrift/connection.js +++ b/lib/nodejs/lib/thrift/connection.js @@ -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;