Repository navigation
Conversation
This branch has not been deployed
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.
Describe the pull request
A successful
Appendcan disappear from the live configuration when it finishes whileReloadis reading. Reload snapshots the data sources before reading them, then replaces the file contents with data from that snapshot even if Append has already installed a new source.This change checks the source count under the write lock before publishing the reloaded data. If Append added sources while the reads were in flight, Reload retries with the full list. A channel-controlled regression covers both an overwritten value and a newly added key.
Link to the issue: n/a (found while inspecting the reload and append implementation).
Verification
The regression failed against the original code and passed 30 iterations with the race detector after the fix. The offline Go 1.27 runner also passed the package build, focused vet and formatting checks. The full upstream suite could not start because Testify v1.11.1 was unavailable offline.
Checklist
AI usage
OpenAI Codex identified the race, wrote the fix and regression, ran the verification, and drafted this PR.