Repository navigation
fix: atomic load for ActiveHostConfigurationProvider - #11815
Merged
Merged
Conversation
Jacob Viau (jviau)
force-pushed
the
u/jviau/config-race
branch
from
June 10, 2026 21:16
9704bb5 to
f1d824b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the ActiveHostConfigurationSource configuration provider against concurrent read/write failures by building a fresh configuration dictionary and swapping it into ConfigurationProvider.Data atomically, avoiding “collection was modified” exceptions when consumers enumerate during refresh.
Changes:
- Refactors
ActiveHostConfigurationSourceto use a primary constructor and updatesActiveHostConfigurationProvider.Load()to rebuild into a new dictionary and then swapDatain one assignment. - Keeps the provider subscribed to
ActiveHostChangedand preserves the existing “first key wins” behavior when enumerating underlying configuration. - Minor XML doc punctuation fixes in
BlobServiceClientProvider.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/WebJobs.Script/Config/ActiveHostConfigurationSource.cs | Rebuilds and atomically swaps the provider Data dictionary during Load() to prevent concurrent enumeration exceptions. |
| src/WebJobs.Script/StorageProvider/BlobServiceClientProvider.cs | Updates XML documentation punctuation only. |
Lilian Kasem (liliankasem)
approved these changes
Jun 11, 2026
sarah (satvu)
approved these changes
Jun 11, 2026
Jacob Viau (jviau)
added a commit
that referenced
this pull request
Jun 12, 2026
* fix: atomic load for ActiveHostConfigurationProvider * fix: atomic load for CompatEnvironmentVariablesProvider
v-selvarajbh
added a commit
that referenced
this pull request
Jun 12, 2026
* Update version to 4.1051.200 * Clear release notes * fix: avoid health check auth for non-expanded requests (#11816) * fix: atomic load for ActiveHostConfigurationProvider (#11815) * fix: atomic load for ActiveHostConfigurationProvider * fix: atomic load for CompatEnvironmentVariablesProvider --------- Co-authored-by: azure-functions-release[bot] <223311270+azure-functions-release[bot]@users.noreply.github.com> Co-authored-by: Jacob Viau <javia@microsoft.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.
Issue describing the changes in this PR
part of #11787
While investigating the blob client issue above, I also identified a potential enumerable read/write conflict. We do not atomically swap the
Data, but instead update it in place. Any config consumers enumerating thatDatadictionary at the same time will lead to exceptions. I have verified this exception can be seen occasionally in our logs.Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-procbranch to be included in Core Tools and non-Flex deployments.in-procbranch is not requiredrelease_notes.md