Temp directories are never cleaned up: PipelineRunner leaks one per instance, and test fixtures leaked 7 GB into a tmpfs /tmp - #532
Merged
Conversation
…sweep Production: - PipelineRunner no longer creates a per-instance disabled-host-hooks directory; a single shared directory is created once and reused. - ProcessSandbox.DisposeAsync honors DisablePreserveOnDispose even after a preserved disposal, so phase disposal reaps converted retained VMs. - GitHubAppStorePath is now a bound CodeyBoxOptions property instead of an ad-hoc configuration read (consistent with StateDatabasePath). - New bounded startup sweep (TempFileSweeper + TempSweepStartupService, CodeyBox:TempSweep options) removes stale codeybox-* temp entries without following symlinks or touching fresh/live entries. Tests: - All temp-database fixtures migrated to a shared TestScratchDirectory helper that removes the directory, database and SQLite sidecars on disposal; every owner now disposes it. - Test servers isolate their GitHub App store under the fixture scratch. - TrackingSandboxProvider cleans up sandboxes intentionally left preserved/abandoned by preemption and teardown-failure scenarios. Docs: host-requirements section notes the tmpfs consequence. Verification: full suite green (13382 passed); two consecutive full runs leave identical fixed-name /tmp entries with zero variable leftovers. CodeyBox-Prompt-Revision: 1 Co-Authored-By: CodeyBox <noreply@codeybox.invalid> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the shared disabled-host-hooks directory out of the world-writable shared temp path into the per-user application-data directory, where another local user cannot pre-create it as a file, symlink, or hostile hook farm. Creation fails closed with an unpredictable per-process GUID fallback, and the resolver never throws (Lazy must not cache). Drop the sweeper exclusion for the legacy predictable name so planted or leftover entries are reaped once stale; wire the sweeper logger through the startup service; document SkippedFresh as fresh-or-unprovable. CodeyBox-Prompt-Revision: 1 Co-Authored-By: CodeyBox <noreply@codeybox.invalid> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace recursive Directory.Delete with fd-relative O_NOFOLLOW / unlinkat deletion on Linux (per-component re-validation at the sink; any link aborts the entry), plus a re-validating non-recursive fallback elsewhere. Add direct sink regression tests. Narrow a bare catch in test teardown and drop dead exception discards. CodeyBox-Prompt-Revision: 1 Co-Authored-By: CodeyBox <noreply@codeybox.invalid> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Automated via CodeyBox — work item 4eb99834138c4684b956ae047a84b78b
Initiated by CodeyBox operator
Co-Authored-By: CodeyBox noreply@codeybox.invalid
🤖 Generated with CodeyBox