THRIFT-3279 Fix a bug in retry_max_delay
The current max delay is unstable - when retry_delay == retry_max_delay the
second branch is taken, and retry_delay is set to retry_max_delay *
retry_backoff, which is larger than retry_max_delay.
This causes an oscillation between retry_max_delay and retry_max_delay *
retry_backoff.
This simply fixed it.
diff --git a/lib/nodejs/lib/thrift/connection.js b/lib/nodejs/lib/thrift/connection.js
index f067920..4b84b76 100644
--- a/lib/nodejs/lib/thrift/connection.js
+++ b/lib/nodejs/lib/thrift/connection.js
@@ -210,7 +210,7 @@
this.connected = false;
this.ready = false;
- if (this.retry_max_delay !== null && this.retry_delay > this.retry_max_delay) {
+ if (this.retry_max_delay !== null && this.retry_delay >= this.retry_max_delay) {
this.retry_delay = this.retry_max_delay;
} else {
this.retry_delay = Math.floor(this.retry_delay * this.retry_backoff);