From d5c34580f0218323cc6220e4d0ef222915769e34 Mon Sep 17 00:00:00 2001 From: pygraphsql Date: Mon, 3 Apr 2017 17:08:47 -0700 Subject: [PATCH 1/3] fixed problem for failing to close client when catching zookeeper is down --- lib/ConnectionManager.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ConnectionManager.js b/lib/ConnectionManager.js index d3c0226..b5bd774 100644 --- a/lib/ConnectionManager.js +++ b/lib/ConnectionManager.js @@ -214,6 +214,8 @@ ConnectionManager.prototype.getSessionTimeout = function () { ConnectionManager.prototype.connect = function () { var self = this; + if (self.state === STATES.CLOSING) return; + self.setState(STATES.CONNECTING); self.findNextServer(function (server) { From c4ef931b4965f9247c758326926812a038f28ab7 Mon Sep 17 00:00:00 2001 From: pygraphsql Date: Mon, 3 Apr 2017 19:24:20 -0700 Subject: [PATCH 2/3] change to accordingly coding style --- lib/ConnectionManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ConnectionManager.js b/lib/ConnectionManager.js index b5bd774..1eb49eb 100644 --- a/lib/ConnectionManager.js +++ b/lib/ConnectionManager.js @@ -214,7 +214,9 @@ ConnectionManager.prototype.getSessionTimeout = function () { ConnectionManager.prototype.connect = function () { var self = this; - if (self.state === STATES.CLOSING) return; + if (self.state === STATES.CLOSING) { + return; + } self.setState(STATES.CONNECTING); From 8bbde81fc1785ed6f97067f87aba3e8d644ddc94 Mon Sep 17 00:00:00 2001 From: pygraphsql Date: Tue, 4 Apr 2017 18:25:59 -0700 Subject: [PATCH 3/3] format to accordingly coding style --- lib/ConnectionManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ConnectionManager.js b/lib/ConnectionManager.js index 1eb49eb..6c56d76 100644 --- a/lib/ConnectionManager.js +++ b/lib/ConnectionManager.js @@ -215,7 +215,7 @@ ConnectionManager.prototype.connect = function () { var self = this; if (self.state === STATES.CLOSING) { - return; + return; } self.setState(STATES.CONNECTING);