Repository navigation
Guard shell log lifecycle across processes - #140
Merged
luciusmagn merged 3 commits intoOct 28, 2026
Merged
luciusmagn merged 3 commits into
luciusmagn merged 3 commits into
Conversation
luciusmagn
force-pushed
the
fix/shell-log-cross-process-lifecycle
branch
from
October 28, 2026 08:33
59ceb23 to
dd75787
Compare
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.
Fixes #139
Problem
A second process sharing the data directory can report a live shell log as interrupted and delete its output under retention pressure. An allocation abandoned before its manifest is written can also block later shell commands.
Fix
with-shell-log-lockadds a process-shared lock around allocation, capture recording and release, including the existing quota scan and reservation.shell-log--active-precognizes live owners in other processes through ownership leases.shell-log-allocateacquires the lease before publishing the manifest;shell-log--release-ownerreleases it after capture completion or artifact release.shell-log--scan-manifestlets pruning reclaim empty abandoned allocations and leftover sexp-store manifest staging files from interrupted publication, recognized byshell-log--manifest-staging-p, while refusing unexpected contents.shell-log--capture-file-preserves the ownership filename, andshell-log--trim-tombstonesremoves it when the tombstone expires.Tradeoffs
Tests
test-shell-log-cross-process-lifecycle: independent worker processes read live output without interruption or pruning, reclaim storage after owner exit, remove expired ownership files and recover from empty abandoned allocations. A deterministic staging-remnant case verifies reclamation after interrupted manifest publication. It does not test simultaneous allocation starts.Validation
On 0.67.8 (
40e8207e), Linux x86-64, SBCL 2.6.6:./script/check --sourcepasses.shell-log-resourceandshell-log-jobsuites fail 1 of 13 cases on unchanged40e8207eand pass 13/13 with this PR. The staging-remnant case alone fails on the first commit,7240dd34../script/checkon59ceb230: 1,234 cases, 2 failures. The same 2 fail on unchanged40e8207e:test-telemetry-subprocess-deadlines(the saved-core child cannot loadlibcrypto.so.3) andtest-model-catalog-standalone-http(bounded-body assertion).