daemon,gr: mark stale routes in session_loop under shard lock#359
Merged
Conversation
Previously, MarkStale table events were emitted in run() after session_loop() returned, creating an async gap where the peer's advertise channel was already closed but GR families were not yet marked stale. Move MarkStale dispatch into the existing shard loop in session_loop(), where it executes under the same lock that removes peer_event_tx. This eliminates the window between "stop delivering advertise events" and "mark routes stale," and avoids a second full pass over the shards. Because the stale families are known from negotiated_gr.families, GrOutput::MarkStale is no longer needed; remove it from GrState and update tests accordingly. run() now handles only the timer side-effect (GrOutput::StartTimer) from GrState::process. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
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.
Previously, MarkStale table events were emitted in run() after session_loop() returned, creating an async gap where the peer's advertise channel was already closed but GR families were not yet marked stale.
Move MarkStale dispatch into the existing shard loop in session_loop(), where it executes under the same lock that removes peer_event_tx. This eliminates the window between "stop delivering advertise events" and "mark routes stale," and avoids a second full pass over the shards.
Because the stale families are known from negotiated_gr.families, GrOutput::MarkStale is no longer needed; remove it from GrState and update tests accordingly. run() now handles only the timer side-effect (GrOutput::StartTimer) from GrState::process.
Assisted-by: Claude Sonnet 4.6 noreply@anthropic.com