Repository navigation
perf(deploy): batch sealing and overlap build finalization - #170363
Conversation
Keep compiler and plugin bundlers serial, join independent UI and runtime finalization, and preserve every build check. Replace per-file fsync with a failed-closed filesystem barrier before durable publication, and avoid resealing validated releases. Related: #170283.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR batches release durability synchronization and overlaps the staged Control UI build with independent runtime finalization. Example: The reported matched Linux benchmark prepares a freshly built release.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored optimization addresses measured release-preparation costs, and review found no actionable correctness or security defect. Priority: P2 Before mergeNone. FindingsNone. Provenance
Agent review detailsHow this fits togetherThe build orchestrator turns frozen source into runtime and UI artifacts; the deployment controller copies, validates, seals, and publishes those artifacts before the separate activation flow. flowchart TD
Source[Frozen source] --> Compiler[Serial compiler and plugin builds]
Compiler --> Runtime[Runtime finalization]
Compiler --> UI[Staged UI build]
Runtime --> Join[Join writers and finalize metadata]
UI --> Join
Join --> Seal[Validate and seal candidate]
Seal --> Publish[Durable release publication]
Technical reviewBest possible solution: Land the focused optimization through the existing gates, leaving installed-controller adoption with its documented deployment owner. Do we have a high-confidence way to reproduce the issue? This is a performance improvement rather than a current-main bug report; source inspection confirms the serial finalization and individual synchronization costs described by the supplied measurements. Is this the best way to solve the issue? The approach removes redundant work within the existing owners while preserving compiler serialization, failure settlement, permission normalization, and durable publication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 81ad3bf71935. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +138, Docs +23, Other +50. Total +211 across 6 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 12, 2026, 6:59 PM ET / 22:59 UTC. |
…170363) Keep compiler and plugin bundlers serial, join independent UI and runtime finalization, and preserve every build check. Replace per-file fsync with a failed-closed filesystem barrier before durable publication, and avoid resealing validated releases. Related: openclaw#170283.
Related: #170283
What Problem This Solves
Release preparation still spends most of its time building and making the candidate durable before it can be activated.
User Impact
Faster preparation keeps the incumbent serving while the next release becomes ready. This does not deploy the controller, restart a Gateway, change a schema, or change runtime behavior.
Why This Change Was Made
Seal the permission-normalized candidate with one GNU
sync -ffilesystem barrier instead of onefsyncper file and directory. Failed synchronization still fails closed, and publication still fsyncs its parent directory. Reusing an already validated sealed release no longer reseals it.Build the staged Control UI concurrently with independent runtime finalization after the last compiler pass. Join both writers, including failures, before writing final metadata. Keep every build check and the single build owner; no new cache, configuration, or CI-provenance bypass.
The existing integrity contract is documented explicitly: exact source/build/schema/UI-entrypoint identity, complete ownership/mode/symlink validation, and durable publication. It is not a whole-tree cryptographic manifest or protection against root modifying a published tree. Filesystem sync also flushes unrelated dirty writes on that filesystem; it does not evict page-cache contents.
Evidence
Synthetic measurements on the shared Linux benchmark host, constrained to 64 CPUs / 64 GiB, Node 26.8.2 and pnpm 12.9.0, source baseline
395ea60dea89. No production state or services were used.The seal made 204,345 file/directory fsync calls, consuming 80.525 s. The replacement filesystem barrier took 1.250 s. Copying remained 3.50 / 3.61 s and ownership 0.50 / 0.50 s; manifest validation hashes only the UI entrypoint, not every file. Post-build totals include source/candidate/published validation, capacity inventory, copy, ownership, manifest, sealing, durable rename, and compile-cache prewarm.
The matched build pair keeps compiler/plugin bundlers serial and reduces the post-builder window from 29.86 to 16.19 s. Peak cgroup memory was 6.31 / 6.00 GiB. All 20,435 regular payload files are byte-identical, including UI and compressed assets; only the two build-stamp records differ. This is not a symlink-topology comparison.
Source fetch + checkout took 10.52 s and cold-store install 19.63 s. Adding those common setup components to each matched build/preparation gives a component-summed fetch-to-activate-ready estimate of 195.0 → 106.1 s. This is not a timed live controller transaction: lock/ancestry checks and work-tree cleanup are excluded. The first cold serial build took 93.54 s; no equivalent cold candidate build was measured. The under-two-minute target is met by the matched warm-filesystem estimate, not claimed for every cold or contended deployment.
pnpm test test/scripts/build-all.test.ts --maxWorkers=1: 61 passed, 9.793 s test time / 117.06 s wrapper wall time including 69.929 s initial worker preparation on the saturated Mac.Production code grows by 50 lines: concurrent writer joining, failure propagation, and wall-clock timing preserve the existing build lifecycle contract. The per-file durability loop and redundant resealing are removed rather than retained as alternate paths.