Repository navigation
fix(sdk): Restart the links on keepalive after a cancelled connect - #4782
Open
TomPlanche wants to merge 1 commit into
Open
TomPlanche wants to merge 1 commit into
TomPlanche wants to merge 1 commit into
Conversation
|
Thanks for the PR. It is labeled If AI assistance was used to create this PR, you are required to run the Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #4782 +/- ##
=============================================
- Coverage 90.89% 84.81% -6.09%
+ Complexity 3878 3876 -2
=============================================
Files 1564 1504 -60
Lines 407450 297379 -110071
Branches 341308 231237 -110071
=============================================
- Hits 370368 252229 -118139
- Misses 29706 37402 +7696
- Partials 7376 7748 +372
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR address?
Closes #4638
Rationale
A client that loses the caller of its connect must still come back, like a client that is
Disconnected. Without this fix, only an explicitconnect()recovers it, and nothing in the SDK calls one.What changed?
When a caller dropped a
connect()while the reconnect sweep waited between two passes, the client stayed inConnectingwith no slots.keepalive()restarts the links only forDisconnectedor for a slot without a task, so the heartbeat never restarted them, and a request never dials.Now
keepalive()also restarts the links when the abandoned flag of theConnectCoordinatoris set, as @numinnex suggested in the review of #4569. The newconnect()sees the flag, and its sweep disconnects the half-done state before it sweeps again. Thekeepalive_restarts()guard does not change, so an explicit disconnect or a logout stays final. The test from the issue reproduces the bug and now passes.The cancel inside
resume_or_sign_in, afterinstall_bootstrap, is a different path and is not part of this PR.Local Execution
Passed:
cargo fmt --allandcargo clippy -p iggy --all-features --all-targets -- -D warnings.Passed: the test from the issue, which failed on master with
left: Connecting:Passed:
cargo test -p iggy --lib, with 761 tests.Passed: pre-commit hooks with
prek run.AI Usage