Repository navigation
fix(spire): test race so a redelivered SVID can never push twice (#1018) - #1019
Merged
Merged
Conversation
TestNodeSVIDRedeliveryCountsUnchanged took its push baseline once the
bundle_updates{own,initial} counter reached 1, but refreshWorkloadBundle
records that counter BEFORE it calls pushSecrets. In that window the
baseline read 1 push, the initial wake's bundle push then landed as a 2nd,
and the "must not push" assertion blamed it on the redelivery.
Wait for the served generation (publishedGen == gen, written only after
SetSecrets returns) before taking the baseline. The assertion is unchanged.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
added a commit
that referenced
this pull request
Sep 27, 2026
Brings in #1016 (repository-cache keys, cache-save: false, ci-bazel-warmup first steps), #1019 and #1012. publish.yaml keeps both sides: the #1016 setup-bazel cache settings and warm-up step, then the release-environment Quay robot login. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
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.
Verdict: test race, not a code race
What raced.
TestNodeSVIDRedeliveryCountsUnchangedtakes its push baseline (pushesBefore) oncebundle_updates{own,initial}reaches 1. ButrefreshWorkloadBundlerecords that counter before it callspushSecrets. Interleaving on the failing runs:runIdentityRefreshgoroutine):refreshNodeSVID→svid_updates{node,initial}→ push Refactor registrar as xDS server #1{agent:v1, vc:0}.refreshWorkloadBundlebumps gen, recordsbundle_updates{own,initial}=1…gen()(already bumped) andlen(store.snapshot()) == 1.pushSecrets→ push Refactor registry #2{agent:v1, vc:1}.unchanged, no bump, no push. The test then sees 2 pushes vs baseline 1 → "an unchanged node SVID must not push".Evidence: all 21/300 failing runs on
maincarry the same payload — the 2nd push is{…/aether-agent:1 validationContexts:1}, i.e. the initial wake's bundle push, not a push caused by the redelivery (which would carry the same state as push #2 and would have been collapsed by thepublishedGencheck anyway).Why production is not affected. Refresh is already serialised: its only callers are
Start(one synchronousrefreshIdentity, thengo runIdentityRefresh, so there is a happens-before) and the singlerunIdentityRefreshloop, which handles theUpdated()wake and the 30 s tick in oneselect, one at a time. No two refreshes run concurrently, so there is no "both see nothing served yet" window. On top of that,pushSecretsdrops a push whose generation is already published.Fix
The test now waits for the observable effect of the initial wake's last push, the served generation (
publishedGen == gen;publishedGenis written only afterSetSecretsreturns, underpushMu), before it takes the baseline. The "must not push" / "must not bump" assertions are unchanged.Evidence
main(98a84a8):bazel test --config=race --runs_per_test=300 --test_filter=TestNodeSVIDRedeliveryCountsUnchanged //agent/internal/spire:spire_test→ FAILED in 21 out of 300, all with the signature above.--config=race --runs_per_test=300 //agent/internal/spire:spire_test→ PASSED 300/300.bazel test //agent/internal/spire:allgreen;bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //agent/...green;bazel run //:formatclean.Closes #1018
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr