Add support for batch sync to workerd - #116
Open
aron-cf wants to merge 13 commits into
Open
Conversation
Settle the remote filesystem before capturing a deferred sync target and merge later command targets into an existing durable intent. Treat bounded batch completion as progress rather than a failed retry. Keep canceled command streams draining until the command finishes, and leave already-satisfied pull cursors in place.
|
aron-cf
marked this pull request as ready for review
August 21, 2026 16:50
commit: |
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.
Commands currently wait for the full post-command pull before returning. That works for small changes, but an npm install can create thousands of files and run over a request budget. The default sync filter recently dropped
node_modules, so installed packages now survive a replacement workspace runtime.Sync can now move a fixed number of entries or bytes at a time and resume from a path within one revision.
Workspace.push()andWorkspace.pull()keep their existing behavior unless the caller selects batch mode. Commands also acceptsync: "deferred".Deferred mode is intended to batch work across several messages/cycles to avoid CPU saturation. The host can call
retryPendingSync()from its durable object alarm until the captured target is complete. Though for now the default remains inline sync.Deferred targets are captured after pending filesystem writes settle. Later commands extend an existing target, successful batches do not consume the failure retry limit, and cancellation waits for the command to finish before recording its target. Runtime replacement and stale cursor handling keep retries from reporting success against the wrong container.
An example of a container-backed workspace that has a
SyncRetrySchedulerconfigured:After the retry reports
"complete", replacing the runtime and running a command that readsnode_modulesshould use the installed files from the workspace store.