Add exponential backoff to cloud reconnect - #230
Conversation
MazurenkoNick
left a comment
There was a problem hiding this comment.
Review summary
Reviewed 2 changed files in Add exponential backoff to cloud reconnect. Left 4 comment(s) inline.
The backoff logic itself reads well and the reconnecting flag + capped doubling are a clear improvement over the old fixed-rate loop. The main concerns are around the reconnectFuture state machine: it is now mutated from an additional thread without synchronization, and it is never cleared on the destroy/partition-loss path, which can leave the reconnectFuture == null guard permanently blocking a restart. There are also no tests for the new scheduling logic.
This review was auto-generated. Findings may contain errors — please verify before applying changes.
MazurenkoNick
left a comment
There was a problem hiding this comment.
Re-review summary
Re-reviewed Add exponential backoff to cloud reconnect — verified 4 finding(s) from previous review.
| Status | Count |
|---|---|
| ✅ Resolved | 4 |
| 💬 Acknowledged | 0 |
All previous findings have been addressed. Also found 2 minor quality nit(s) in the fix commit, commented inline (test naming/DRY only — nothing blocking).
Finding details
- ✅ BaseCloudManagerService.java (
destroy) —reconnectFuturewasn't cleared on the destroy/partition-loss path — Fixed:destroy()now callscancelReconnect(), which cancels and nulls the future. - ✅ BaseCloudManagerService.java (
scheduleReconnectAttempt) — reconnect state mutated across gRPC and reconnect threads without synchronization — Fixed: all state now guarded byreconnectLock;onEdgeUpdate/destroyshare thecancelReconnect()helper. - ✅ BaseCloudManagerService.java:107 —
180000default duplicated in@Valueandtb-edge.yml— Fixed: annotation default dropped, relying on the yml. - ✅ BaseCloudManagerService.java — no tests for the backoff/state-machine logic — Fixed:
BaseCloudManagerServiceTestadded covering delay doubling/capping, no-op re-entry, timeout reset, and destroy cleanup.
This re-review was auto-generated. Findings may contain errors — please verify before applying changes.
Pull Request description
Put your PR description here instead of this sentence.
General checklist
Front-End feature checklist
Back-End feature checklist