Repository navigation
Conversation
…ntenance Startup recovery used to await the physical sidecar purge of preparing conversation copies before the Host could publish Ready. The purge resolves artifact paths across the whole store, so a workspace with a large accumulated artifact store paid an O(all files) syscall sweep on every Host start and blocked readiness for minutes (apache#4027). Recovery now only queues the copies it decided to discard. The durable headers stay the authority: an entry that never drains is re-derived by the next recovery pass, and readers already treat a preparing copy as inert. Queued discards drain one admission-leased discard at a time through a new HostStorageMaintenance lane, re-reading the header under the lease so a copy committed or discarded in the meantime wins over the stale recovery snapshot. Refs apache#4027 Generated-by: ZCode
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.
Summary
Startup recovery used to await the physical sidecar purge of preparing conversation copies before the Host could publish Ready. The purge resolves artifact paths across the whole artifact store, so a workspace with a large accumulated store paid an O(all files) syscall sweep on every Host start and blocked readiness for minutes (profile and repro in #4027).
Recovery now only queues the copies it decided to discard:
HostStorageMaintenancelane (deferred session discard), reusing the existing bounded-lane pattern (start after Ready, 100 ms active pacing, exponential backoff, drain/close shutdown semantics).This is the readiness half of #4027. The O(store) guard scan inside
preparePurgePathsUnlockeditself (the other half) is intentionally untouched and can follow separately.Refs #4027
Verification
tsc --noEmitclean in@maka/runtime-host;biome checkclean on the five touched files.storage-maintenance.test.ts: sweeps at the active pace while the queue reports work, idles once drained.execution-composition.test.ts"optional context Store cannot open": recovery no longer attempts the purge (no cleanup diagnostic), the maintenance lane takes the queued discard after Ready and reports retries while this environment cannot complete the purge, and the header stayspreparing.recover()untouched and is fully discarded by the lane after Ready.session-revision-two-client-uds,execution-host-recovery,host-kernel, and the fullexecution-compositionsuite were run locally on Windows. Threehost-kernelfailures and twoexecution-compositionfailures (WorkHub does not record resume...,production executor admission discovers...) reproduce identically on a cleanmainbuild on this machine and appear unrelated to this change. The full-composition run also showed the node process not exiting after all 46 tests reported, which also predates this branch. The husky pre-commit hook was bypassed (--no-verify) because it fails to spawnbiome.cmdunder Node 24 on Windows (EINVAL,scripts/biome-staged-check.mjs); the touched files passbiome checkdirectly.AI use
Select exactly one:
Tool(s) and scope: ZCode (GLM). Read the recovery/purge path and drafted the change and tests; the human contributor reviewed the approach, ran the verification locally, and owns the result. Commits carry
Generated-by: ZCode.