fix(ipc): reset the state subscription's reconnect wait after a good connection - #740
Merged
Merged
Conversation
…connection StateSubscription._run reset its backoff only when _follow() returned normally, which happens only on stop(). Every real disconnect raises ControlError, so the wait kept doubling across connections: after successive display restarts the web resubscribed 1, 2, 4, 8, 16 and then 30 s later for good, answering from one-shot state.get connections in the meantime. The docs promise "1 s up to 30 s" per outage. The wait now goes back to the minimum once a connection got as far as storing a snapshot, whatever ended it. A display without the stream (unknown_command) is still retried at the slow interval. The frozen-timestamp bug found in the same review is fixed by #737. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Summary
The web's state subscription (
StateSubscription._run,src/ipc/client.py, from #735) reset its reconnect wait only when_follow()returned normally. That happens only onstop(). Every real disconnect raisesControlError, so the wait kept doubling across connections. After successive display restarts the web resubscribed 1, 2, 4, 8, 16 and then 30 s later, permanently. Meanwhile it answered from one-shotstate.getconnections. The docs describe "1 s up to 30 s" per outage.Fix: the wait goes back to the minimum once a connection got as far as storing a snapshot, whatever ended it. A display without the stream (
unknown_command) is still retried at the slow interval.The other #735 bug found in the same review, subscriber timestamps freezing so
current-statusansweredmode: nullafter 2 minutes, is fixed separately by #737. This PR does not touch it, and it merges cleanly with #737.Tests
TestReconnectBackoff(2, no socket needed, so they run on Windows too).client.pythe reset test fails; it expected[1, 2, 4, 1, 1, 2]and got[1, 2, 4, 8, 16, 30].test_ipc_state_stream.py+test_state_stream_readers.py: 70 passed, 11 skipped (AF_UNIX).Part of a bug sweep
This is one of 10 independent fix PRs from one sweep, all based on
mainef69201.main: the same 62 failures and 6 errors on both. These are the known Windows path and file-locking tests. 191 more tests pass.test_backup_manager.py::test_create_backup_contents(os.replace→WinError 5on a temp zip), was a Windows file-lock flake. It passes on rerun, and nothing here touchescreate_backup.main, with a clean start and no errors or render stalls in the journal. ledpi is back on plainmain.🤖 Generated with Claude Code