Fix gr#358
Merged
Merged
Conversation
Per-family Source objects make it possible to identify routes by (remote_addr, family) alone, without passing Arc<Source> through the event layer. This change exploits that to eliminate the stale source tracking map (gr_source / DisconnectInfo::source) and simplify the whole GR plumbing. TableEvent::Disconnected and MarkStale now carry (IpAddr, Family) instead of Arc<Source>. RoutingTable::drop() and restale() take the same pair. The helper functions gr_drop_source, gr_restale_source, and drain_stale_sources are gone; replaced by gr_drop_families, gr_drop_stale_families, and gr_restale_families. A new RoutingTable::drop_stale(addr, family) removes only stale paths, leaving fresh routes from a reconnected session intact. It is used for EOR receipt and deferral-timer expiry where the peer may have already sent fresh routes; gr_restart_timer_expired keeps using drop() because the peer has not yet reconnected at that point. PeerContext::gr_source removed. Timer callbacks receive addr as a plain argument captured at spawn time from PeerSession::remote_addr, so no need to store it in PeerContext. handle_advertise switches from Arc::ptr_eq to remote_addr equality, which also correctly filters routes from previous sessions of the same peer. Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
…s active When a peer disconnects with GR negotiated, the previous code skipped route removal entirely for all families. Non-GR families should be dropped right away just like a normal disconnect; only the GR-capable families are preserved as stale. Introduce families_to_drop_on_disconnect() to compute which families to drop, and call it unconditionally in session_loop. GR families are excluded from the drop set; every other session family is dropped via Disconnected(addr, family) as before. Add unit tests for the helper and functional tests that verify routing table state after the drop events are applied. 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.
No description provided.