Repository navigation
Conversation
Cloudflare's Worker version list can trail a write by minutes. Before the upload, wait while the list lacks the active version. After the upload, wait while the list still equals the baseline, on a schedule of about 5.5 minutes instead of 250 ms and 500 ms. Failed reads keep their two quick retries. Refs voidzero-dev#891
This branch has not been deployed
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.
Fixes #891 for the version-list paths. The
triggers-failedcase in the issue is not changed here.Change
Cloudflare's Worker version list can trail a write by minutes. The deploy now waits for it in the two places where the expected state is known:
deployments statusreported. This read had no retry.Both use
STALE_VERSION_HISTORY_DELAYS_MS: 250 ms doubling up to 30 s, 17 waits, about 5.5 minutes in total. Each wait checksverifyUploader()and the first one reports progress. The schedule can be overridden with the newversionHistoryRetryDelaysMsoption.Why this length: in the runs in #891 a new version was still missing 52 s after creation and was listed within about 4.5 minutes. #880 and #868 retried for a second or less, which does not reach that. If maintainers want a shorter cap, change the constant.
What does not change
inheritance-source-changedbefore the upload,inheritance-source-unavailableafter it). Nothing is uploaded when the pre-upload wait runs out.stabilizeCloudflareVersionTriggersis untouched. The logs in Cloudflare deploy stops on a lagging Worker version list (inheritance-source-changed, triggers-failed) #891 do not show what its reads returned.Tests
packages/deploy-cloudflare/test/unit/version.test.ts:The new pre-upload tests and the changed stale-list case fail on
mainand pass here (5 failures without the change).Verified locally
Run in a shell with no
CLOUDFLARE_*,CF_*or wrangler variables (env | grep -ciE 'cloudflare|^CF_|wrangler'printed 0). The tests injectrunWrangler, so nocforwranglerprocess starts.vp test run packages/deploy-cloudflare/test/unit/version.test.ts: 231 passedvp check: no warnings, lint errors or type errorsvp run check:types: 35/35 successfulvp run test:all: 92 of 93 tasks passed. The one failing task wasplatform-api-integration-threads, 12 tests, because Playwright's Chromium was not installed. Afterplaywright install chromiumthe six failing files passed (204 tests).