Document sync vs async + fallback strategy trade-offs#146
Merged
Conversation
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
Captures the resilience-strategy guidance that came out of the post-merge analysis of how the new
initTimeoutwatchdog and the existingMultiProviderpatterns interact for production workloads. Two doc files updated, no code changes.What lands
docs/providers.md— new "Choosing a strategy — sync vs async, with vs without fallback" section. Sits after the existing "Async Variants" section, before "Provider Registry". Contains:{sync, async} × {fallback, no fallback}to who they're right for.initTimeoutas a hard ceiling on cold-start latency; async uses it as a bounded uncertainty window.providerStatusfrom the readiness endpoint, (2) keepEnvVarProviderfor only the flags whose default-value correctness matters.Fatal: it's a "stop waiting, take operator action" signal, not a tombstone — a laterPROVIDER_READYevent transitionsFatal → Ready.initTimeout(production cold-start vs CI vs sync-mode-is-the-boot-deadline).docs/optimizely.md— expanded operational guidance.Fatal): rewritten with the readiness-check pattern explicit; clarifies thatFatalis recoverable so don't treat it as permanent.EnvVarProviderfor the small set of flags where defaults are unsafe). Each pattern has a runnable snippet usingOptimizelyProvider.make, a fit-for-purpose rationale, and the trade-offs it accepts.CHANGELOG.md—[Unreleased]entries pointing at the new sections.Why this is worth the change
Without this guidance, users picking a topology have to derive these trade-offs themselves. The full chain —
fromProviderAsyncdefaults, the 30 s watchdog,MultiProvider+FirstSuccessfulStrategy's "Ready if any sub-provider is Ready" semantics, the recovery path underFatal— is implicit in the codebase but not visible at any single doc location. The new sections make the implicit decisions explicit and give operators a fit-for-purpose pattern to pick from rather than a "here are the knobs, good luck" set of APIs.