Page MenuHomePhabricator

[lib] Retry Tunnelbroker connection after closing
ClosedPublic

Authored by bartek on Sep 18 2024, 6:38 AM.
Tags
None
Referenced Files
F3345607: D13382.diff
Fri, Nov 22, 6:33 AM
Unknown Object (File)
Wed, Nov 20, 12:47 PM
Unknown Object (File)
Wed, Nov 20, 7:02 AM
Unknown Object (File)
Wed, Nov 20, 6:39 AM
Unknown Object (File)
Wed, Nov 20, 5:39 AM
Unknown Object (File)
Fri, Nov 1, 9:39 AM
Unknown Object (File)
Fri, Nov 1, 9:38 AM
Unknown Object (File)
Fri, Nov 1, 9:38 AM
Subscribers

Details

Summary

Details in ENG-9246.
Added a retry counter variable and a timeout.

  • The effect hook has dependency on this variable
  • It is increased after each retry
  • Retry has to have interval to avoid infinite effect loop. Defaulted to 5s

Previously, effect wasn't triggered if socketState.connected was already false. Change false -> false doesn't trigger the hook, so socket wasn't recreated.

Test Plan
  • On native: Turned airplane mode on/off.
  • On web: turned wifi on/off.

Observed console logs. The connection was successfully restored after network coming back.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Sep 18 2024, 7:59 AM
lib/tunnelbroker/tunnelbroker-context.js
293–296 ↗(On Diff #44315)

Actually should be 0, we don't retry here

kamil added inline comments.
lib/tunnelbroker/tunnelbroker-context.js
91 ↗(On Diff #44315)

I am thinking about less time here, e.g. for the keyserver we have export const clientKeyserverSocketReconnectDelay = 2000; but not sure

This revision is now accepted and ready to land.Sep 18 2024, 9:59 AM
lib/tunnelbroker/tunnelbroker-context.js
91 ↗(On Diff #44315)

Reflecting keyserver makes sense, I'll change to 2000