Repository navigation
Do not block when informing the view changer of a new view - #713
Merged
pfi79 merged 2 commits intoOct 19, 2026
Merged
Conversation
The controller informs the view changer of a new view after a sync, from its run loop. InformNewView sent on a channel with a buffer of one, so if the view changer had not processed the previous view yet, the controller's run loop blocked until it did. Keep only the highest pending view instead, so InformNewView never blocks and the view changer still moves to the latest view. TestInformViewChanger relied on the second call blocking to know the first was processed; it now waits for the timers to be restarted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
Contributor
|
Document that InformNewView is called from the controller's run loop, why keeping only the higher pending view loses nothing, and that the pending view is held only in informChan so concurrent calls are safe. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
Contributor
Author
|
Thanks for the review!
(Written by Claude on behalf of Hagar Meir.) |
pfi79
approved these changes
Oct 19, 2026
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.
Written by Claude (Anthropic's AI assistant) on behalf of Hagar Meir.
Fixes #712.
The controller informs the view changer of a new view after a sync, from its run loop.
InformNewViewsent on a channel with a buffer of one. So if the view changer hadn't yet processed the previous view, the controller's run loop blocked until it did.Changes
InformNewViewnever blocks. If a view is already pending, it keeps only the higher of the two, so the view changer still moves to the latest view.TestInformNewViewDoesNotBlockinforms a view changer that isn't running yet of three views. It checks that no call blocks, and that the view changer ends up in the latest view. Onmainthe second call blocks.TestInformViewChangerused to callInformNewViewtwice, relying on the second call blocking to know the first was processed. It now waits for the view changer to restart the request timers, which it does once it processes the view.🤖 Generated with Claude Code