Repository navigation
fix(xtcp): uplinks follow a route change - #354
Open
randomizedcoder wants to merge 5 commits into
Open
randomizedcoder wants to merge 5 commits into
randomizedcoder wants to merge 5 commits into
Conversation
Table tests for the uplink refresh: a metric swap moves the stamp, an unchanged list skips sysfs and lldpd, a lost uplink falls back to the physical NICs, lldpd failing keeps the NIC columns, the refresh interval rules, the ticker loop, and a race test that a record never mixes two stamps. They don't build yet: uplinkSources and the refresh are next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The uplink columns were chosen once at startup, so a route-metric swap moved egress and locality within a refresh but left the uplinks naming the old interface until a restart. Auto-detected uplinks are now re-read every locality_refresh_interval (0 = never; pinned uplink_interfaces are never re-read). The stamp is an atomic.Pointer swapped whole, so a record never mixes two. An unchanged list costs one /proc read; a changed one is read again from sysfs and lldpd off the hot path. Outcomes count under function=refreshUplinks: unchanged, changed, lldp_error. applyEnrichment: 18.2-20.1 ns/op vs 17.9-18.2 before (host load 5-9), 0 allocs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After poll 2 (the fixture) the capture moves the e1000e's default route in front of ionic0's, waits for refreshUplinks to count the change and for a poll that starts after it, and checks that poll's uplink1 is the e1000e. stop_and_fetch_second_poll takes an optional path for the newest object; with one argument it behaves as before (families). The golden collector refreshes every 5s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
locality_refresh_interval(default 60s, 0 = never); pinnedUplinkInterfacesnever refresh.atomic.Pointer, swapped whole: records never mix two stamps.BenchmarkApplyEnrichmentUplink~18-20 ns/op vs ~18 before, 0 allocs.function="refreshUplinks", outcomesunchanged/changed/lldp_error.-race.uplink_follows_metricswaps the ionic0/e1000e route metrics and expectse1000e,ionicon a later poll; the kept poll is from before the swap, so the fixture is unchanged (xtcp2-golden diffclean).🤖 Generated with Claude Code