Add optional parameter to configuration providers for non-blocking startup#1745
Draft
GeorgeTsiokos wants to merge 1 commit intodapr:masterfrom
Draft
Add optional parameter to configuration providers for non-blocking startup#1745GeorgeTsiokos wants to merge 1 commit intodapr:masterfrom
GeorgeTsiokos wants to merge 1 commit intodapr:masterfrom
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 Fixes dapr#993 dapr#345 dapr#1403 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: George Tsiokos <george@tsiokos.com>
Contributor
|
Do note that I just merged a PR to support xUnit v3 so your unit/integration tests may need a refresh. |
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.
Summary
optionalparameter toAddDaprConfigurationStore,AddStreamingDaprConfigurationStore, andAddDaprSecretStoreextension methods so applications can start without blocking on Dapr sidecar availabilityLoadInBackgroundAsyncin both providers with narrowed exception handling (OperationCanceledException+DaprException) instead of a broadcatch (Exception)that silently swallowed programming errorsCancellationTokenSourcein both providersStringComparerinconsistency (InvariantCultureIgnoreCase→OrdinalIgnoreCase) inFetchSecretsAsyncreadonlyinDaprConfigurationStoreProviderfor consistency withDaprSecretStoreConfigurationProvider.editorconfigand adds missing trailing newlinesTest plan
GetReloadToken()callbacks for deterministic assertions (no fragileTask.Delaypolling)optional: truewith real Dapr sidecar (sidecar down at startup → starts later → config populates)optional: false(default) behavior unchanged — blocks startup as before🤖 Generated with Claude Code