@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When disconnected from Aphlict after a successful connection, retry the first reconnect right away

Summary:
Fixes T12567. We currently retry after 2s, 4s, 8s, 16s, ...

If we connected cleanly once, retry the first time right away. There are a bunch of reasonable cases where this will work fine and we don't need to wait. Then we fall back: 0s, 2s, 4s, 8s, ...

Test Plan: {F4911905}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12567

Differential Revision: https://secure.phabricator.com/D17706

+19 -9
+6 -6
resources/celerity/map.php
··· 10 10 'conpherence.pkg.css' => 'a34d59bd', 11 11 'conpherence.pkg.js' => '5f86c17d', 12 12 'core.pkg.css' => '959330a2', 13 - 'core.pkg.js' => 'd7ca5b9a', 13 + 'core.pkg.js' => 'cb50c410', 14 14 'darkconsole.pkg.js' => 'a2faee86', 15 15 'differential.pkg.css' => '90b30783', 16 16 'differential.pkg.js' => 'ddfeb49b', ··· 245 245 'rsrc/externals/javelin/lib/Sound.js' => '949c0fe5', 246 246 'rsrc/externals/javelin/lib/URI.js' => 'c989ade3', 247 247 'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8', 248 - 'rsrc/externals/javelin/lib/WebSocket.js' => '0c4969d6', 248 + 'rsrc/externals/javelin/lib/WebSocket.js' => '3ffe32d6', 249 249 'rsrc/externals/javelin/lib/Workflow.js' => '1e911d0f', 250 250 'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8', 251 251 'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b', ··· 753 753 'javelin-view-interpreter' => 'f829edb3', 754 754 'javelin-view-renderer' => '6c2b09a2', 755 755 'javelin-view-visitor' => 'efe49472', 756 - 'javelin-websocket' => '0c4969d6', 756 + 'javelin-websocket' => '3ffe32d6', 757 757 'javelin-workboard-board' => '8935deef', 758 758 'javelin-workboard-card' => 'c587b80f', 759 759 'javelin-workboard-column' => '21df4ff5', ··· 981 981 'javelin-dom', 982 982 'javelin-router', 983 983 ), 984 - '0c4969d6' => array( 985 - 'javelin-install', 986 - ), 987 984 '0ca788bd' => array( 988 985 'javelin-behavior', 989 986 'javelin-stratcom', ··· 1147 1144 'javelin-util', 1148 1145 'javelin-workflow', 1149 1146 'javelin-stratcom', 1147 + ), 1148 + '3ffe32d6' => array( 1149 + 'javelin-install', 1150 1150 ), 1151 1151 '408bf173' => array( 1152 1152 'javelin-behavior',
+13 -3
webroot/rsrc/externals/javelin/lib/WebSocket.js
··· 130 130 _onopen: function() { 131 131 this._isOpen = true; 132 132 133 - // Reset the reconnect delay, since we connected successfully. 134 - this._resetDelay(); 133 + // Since we connected successfully, reset the reconnect delay to 0. 134 + 135 + // This will make us try the first reconnect immediately after a 136 + // connection failure. This limits downtime in cases like a service 137 + // restart or a load balancer connection timeout. 138 + 139 + // We only do an immediate retry after a successful connection. 140 + this._delayUntilReconnect = 0; 135 141 136 142 var handler = this.getOpenHandler(); 137 143 if (handler) { ··· 190 196 // Increase the reconnect delay by a factor of 2. If we fail to open the 191 197 // connection, the close handler will send us back here. We'll reconnect 192 198 // more and more slowly until we eventually get a valid connection. 193 - this._delayUntilReconnect = this._delayUntilReconnect * 2; 199 + if (!this._delayUntilReconnect) { 200 + this._resetDelay(); 201 + } else { 202 + this._delayUntilReconnect = this._delayUntilReconnect * 2; 203 + } 194 204 195 205 // Max out at 5 minutes between attempts. 196 206 this._delayUntilReconnect = Math.min(this._delayUntilReconnect, 300000);