Repository navigation
perf(sandbox): mount org-fs volumes concurrently at daemon boot - #5333
Merged
Merged
Conversation
pedrofrxncx
enabled auto-merge (squash)
July 28, 2026 15:38
decocms Bot
pushed a commit
that referenced
this pull request
Jul 28, 2026
PR: #5333 perf(sandbox): mount org-fs volumes concurrently at daemon boot Bump type: patch - @decocms/sandbox (packages/sandbox/package.json): 1.24.2 -> 1.24.3 - deploy/helm/sandbox-env (chart 0.9.34) (deploy/helm/sandbox-env/values.yaml deploy/helm/sandbox-env/Chart.yaml): image.tag/appVersion -> 1.24.3 Deploy-Scope: both
This was referenced Jul 30, 2026
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.
Source: reduction/optimization found while hunting the org-fs filesystem-abstraction area (issue #2884's focus area) —
MountManager.start()inpackages/sandbox/daemon/org-fs/mount-manager.ts.Why:
start()mounted each configured org-fs volume one at a time (for (...) await this.mountOne(m)), even though every volume is fully independent — its ownOrgFsClient, its own loopback WebDAV server, its own rclone process and free port. EachmountOnecan take real time (spawn rclone, then poll its rcvfs/listup toREADY_TIMEOUT_MS= 15s in the worst case). A sandbox mounts at least 3 volumes today (home,outputs,uploads) plus one more per configured public skill set (buildOrgFsConfiginapps/api/src/file-storage/mount/provisioning.ts), so the sequential loop directly adds to sandbox boot latency the agent is blocked on — pure serialized network/process-spawn work with no ordering dependency between volumes.Fix: mount all volumes concurrently with
Promise.all(config.mounts.map((m) => this.mountOne(m))).mountOnealready catches its own errors and is a self-contained "never throws, skip on failure" unit (each mount independently tries/logs/skips), so running them concurrently doesn't change failure semantics — a failing volume still just gets skipped, others still mount.this.active.push(entry)is a synchronous array push inside each async continuation, so no race there (JS is single-threaded). Total boot time now bounds to the slowest single mount instead of the sum of all of them.Verify:
cd packages/sandbox && bunx tsc --noEmit(clean) andbun test packages/sandbox/daemon/org-fs/mount-manager.test.ts(12 pass, unchanged — the tests already sort results before asserting, so they don't depend on mount order).Local checks run:
bun run fmt, targetedtsc --noEmitinpackages/sandbox, and the single test file above. Full CI validates the rest.Summary by cubic
Mount org-fs volumes concurrently during sandbox daemon boot to cut startup latency. Boot time is now limited by the slowest mount instead of the sum, aligning with #2884’s org-fs performance focus.
Promise.allinpackages/sandbox/daemon/org-fs/mount-manager.ts; mounts run independently with unchanged failure semantics.Written for commit c2d598f. Summary will update on new commits.