You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2015/07/30 23:56:00 UTC
thrift git commit: THRIFT-3279 Fix a bug in retry_max_delay
Repository: thrift
Updated Branches:
refs/heads/master 5445e3fde -> 4ed2b855e
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.
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/4ed2b855
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/4ed2b855
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/4ed2b855
Branch: refs/heads/master
Commit: 4ed2b855e9dec14afe859330e4f620d026d903e3
Parents: 5445e3f
Author: Itay Duvdevani <du...@fb.com>
Authored: Thu Jul 30 08:49:56 2015 +0300
Committer: Roger Meier <ro...@apache.org>
Committed: Thu Jul 30 23:55:34 2015 +0200
----------------------------------------------------------------------
lib/nodejs/lib/thrift/connection.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/4ed2b855/lib/nodejs/lib/thrift/connection.js
----------------------------------------------------------------------
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 @@ Connection.prototype.connection_gone = function () {
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);