Skip to content

fix: isolate config snapshots to eliminate provider map race - #10

Open
jearthliu wants to merge 4 commits into
jahmeergnlt:mainfrom
jearthliu:fix/isolate-config-snapshots
Open

fix: isolate config snapshots to eliminate provider map race#10
jearthliu wants to merge 4 commits into
jahmeergnlt:mainfrom
jearthliu:fix/isolate-config-snapshots

Conversation

@jearthliu

@jearthliu jearthliu commented Jul 31, 2026

Copy link
Copy Markdown

Fixes the provider-mutates-after-send race with a send-side snapshot contract:

  • New Configuration.Snapshot() helper: providers send a deep copy they fully own, so the config through the channel is never shared with provider maps.
  • GetConfigurationChan() documents the ownership contract: send a Snapshot, or never mutate after send.
  • The watcher still copies before applying (defense-in-depth) and GetConfig() returns a copy.

Consumer-side copying alone cannot stop a provider that mutates a shared map after sending; snapshot-on-send is the actual fix. Closes #1.

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.

🎯 Fix Race Condition Causing Stale Middleware Chain During Concurrent Provider Updates

1 participant