Skip to content

daemon,gr: mark stale routes in session_loop under shard lock#359

Merged
fujita merged 1 commit into
osrg:masterfrom
fujita:refactor-gr
May 19, 2026
Merged

daemon,gr: mark stale routes in session_loop under shard lock#359
fujita merged 1 commit into
osrg:masterfrom
fujita:refactor-gr

Conversation

@fujita
Copy link
Copy Markdown
Member

@fujita fujita commented May 19, 2026

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

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>
@fujita fujita merged commit e5c2506 into osrg:master May 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant