Repository navigation
[Sandbox, Containers] Fix examples and snapshot facts - #34571
Closed
ghostwriternr wants to merge 5 commits into
Closed
ghostwriternr wants to merge 5 commits into
ghostwriternr wants to merge 5 commits into
Conversation
Two requests that opened a tunnel for the same port at once each stopped and started cloudflared in the same directory, so one tunnel could leak and the recorded process ID could belong to the process that exited, the race the server page already guards against. Keep one start promise per port, so overlapping requests wait for the same start and get the same URL.
The Files reference held two procedures, replacing a file through a temporary file and walking a directory tree, which belong in a how-to and were written as fragments that a reader could not call over RPC. Add Replace a file in one step and List a directory tree to the file how-to as Durable Object methods, and link them from the reference.
The clone how-to set the inactivity timeout only after start(), so a restarted Durable Object dropped it, and a second request ran git clone into a full /workspace and failed. Two requests at once each started a clone. Restore the timeout in a constructor, skip the clone when the running container already has /workspace/.git, and share one clone between requests that overlap.
The DirectoryBackup reference told readers to call intercept() again whenever a restarted Durable Object found the container running, and held the setup code for that. A deploy probe showed that the routes belong to the container and survive a restart, and that their order is fixed until a new container starts. State those facts in the reference, and move the setup into the backup how-to as a shared setup that registers the backup route before the catch-all on each new container.
The snapshots guide said a snapshot captures the full container filesystem and its complete filesystem state. snapshotContainer() saves only the writable root filesystem: separately mounted filesystems and the tmpfs at /run start empty after a restore. Name the writable root filesystem and list what it leaves out.
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://sandbox-audit-code.previews.developers.cloudflare.com (commit c8deaf4)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
Contributor
Contributor
|
@ghostwriternr This draft pull request has had no activity for 3 days. It will close after 7 days of inactivity. Transition to ready for review if ready. A codeowner can comment |
Contributor
|
@ghostwriternr Closing this draft pull request after 7 days of inactivity. Re-open at a later date and transition to ready for review when you are ready if you seek review. |
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
Several Sandbox examples broke under overlapping requests or a Durable Object restart, and two pages described container behavior incorrectly.
cloudflared, so one tunnel could leak. Tunnels now share one start per port.start(), so a restarted Durable Object dropped it, and a second request rangit cloneinto a full/workspace. The guide now restores the timeout in the constructor, skips the clone when/workspace/.gitexists, and shares one clone between overlapping requests.intercept()again after a Durable Object restart. The routes belong to the container and survive the restart, and their order is fixed until a new container starts. The reference now says so, and the setup moves to Back up a directory to R2, which registers the backup route before the catch-all on each new container.Documentation checklist