Add optional parameter to configuration providers for non-blocking startup#1844
Merged
Conversation
…artup Configuration and secret store providers now accept an `optional` parameter that allows applications to start without blocking on sidecar availability. When optional, configuration loads in the background with resilient retry logic that handles transient Dapr errors gracefully. - Add `optional` parameter to AddDaprConfigurationStore and AddDaprSecretStore - Harden LoadInBackgroundAsync to catch OperationCanceledException and DaprException separately, avoiding silent swallowing of programming errors - Dispose CancellationTokenSource in both providers to prevent resource leaks - Fix StringComparer inconsistency (InvariantCultureIgnoreCase → OrdinalIgnoreCase) - Mark fields readonly in DaprConfigurationStoreProvider for consistency - Restore UTF-8 BOM per .editorconfig and add missing trailing newlines - Add deterministic tests using reload tokens instead of fragile Task.Delay Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: George Tsiokos <george@tsiokos.com>
Tests verify three scenarios using secretstores.local.file (no external deps): - optional:true with delayed sidecar: config populates once sidecar starts - optional:false (default): Build() blocks until sidecar ready, secrets populated - Disposal during background load: exits cleanly with no hang Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: George Tsiokos <george@tsiokos.com>
…s around Count Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…kground tasks have started may cause ObjectDisposedException races Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
… instead of calling `Set` repeatedly Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
6 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1844 +/- ##
==========================================
+ Coverage 63.46% 63.55% +0.09%
==========================================
Files 312 313 +1
Lines 9279 9431 +152
Branches 1101 1106 +5
==========================================
+ Hits 5889 5994 +105
- Misses 3130 3175 +45
- Partials 260 262 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…m/dapr/dotnet-sdk into config-providers-optional-startup
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
This was referenced Jun 11, 2026
This was referenced Jun 16, 2026
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.
Description
Completion of work started in #1745
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #1748
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: