THRIFT-3280 Initialize retry variables on construction
Currently retry variables are only initialized after a connection has been
successfully established. When the initial connection fails the retry logic is
broken since the state has not been properly initialized.
To solve this, we need to initialize the retry state before the initial
connect() request.
diff --git a/lib/nodejs/lib/thrift/connection.js b/lib/nodejs/lib/thrift/connection.js
index e836e30..f067920 100644
--- a/lib/nodejs/lib/thrift/connection.js
+++ b/lib/nodejs/lib/thrift/connection.js
@@ -41,6 +41,7 @@
this.protocol = this.options.protocol || TBinaryProtocol;
this.offline_queue = [];
this.connected = false;
+ this.initialize_retry_vars();
this._debug = this.options.debug || false;
if (this.options.max_attempts &&