fix(ci): reserialize dynamic providers before refresh#86
Closed
fix(ci): reserialize dynamic providers before refresh#86
Conversation
Split `make up` into two phases: a plain `pulumi up` first, then `pulumi up --refresh`. Dynamic providers serialize their implementation into state at create/update time. During refresh, the serialized `read()` runs — so any provider-code change (like the Discord 429 retry logic) doesn't take effect until a successful update writes the new `__provider` to state. Running refresh first used the stale serialized code from the last successful deploy, which had no rate-limit handling, failing on parallel Discord member lookups. Also bump discordFetch maxRetries from 5 to 10 for headroom against ~68 parallel refresh reads.
Pulumi PreviewClick to expand preview output |
Member
Author
|
Pushing directly to main instead. |
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
Deploy has been failing since #83 added
--refresh. Root cause: Pulumi dynamic providers serialize their implementation into each resource's__providerstate field at create/update time. During refresh, the serializedread()runs — not the current source. The state still held the pre-#84discordFetch(no 429 retry), so ~52 of 68 parallel Discord member reads rate-limited and failed. Chicken-and-egg: refresh fails → no update → state keeps stale code → refresh fails again.make upinto two phases. Phase 1 (pulumi up --yes) serializes current provider code into state for any changed resources. Phase 2 (pulumi up --refresh --yes) refreshes using the freshly serializedread().maxRetries5 → 10 for headroom against Discord's rate limit during parallel refresh reads.Test Plan
npm run checkpasses (23/23)cat -et@pulumi/pulumi/cmd/dynamic-provider/index.js:update()at L269 usesgetProvider(news)(new code),read()at L235 uses state's__provider— so phase 1 writes new code before phase 2 reads it