Repository navigation
fix(server): sweep stale worktree trash dirs via rm -rf subprocess - #7
Merged
Merged
Conversation
- Delete worktree trash directories with a spawned `rm -rf` instead of `fs.remove`, keeping large tree walks off the libuv threadpool and tolerating files rm can't unlink
- Sweep and clean up any stale `.{name}.removing-*` trash dirs left behind by earlier failed removals, not just the one just renamed aside
- Add integration test covering sweep of stale trash directories
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
What Changed
Worktree removal now deletes its rename-aside trash directory with a child
rm -rfsubprocess instead offs.rm, and sweeps any other.{name}.removing-<hex>trash directories left behind in the same parent by earlier removals.Why
Deleting large worktree trees with
fs.rmruns the walk on Node's libuv threadpool, which is shared with WebSocket compression and other server file I/O, so a multi-gigabyte tree could starve those.fs.rmalso aborts the whole walk on the first file it can't unlink (e.g. macOS App Management denying unlinks inside.appbundles), which could leave a trash directory stranded forever. Shelling out torm -rfkeeps the walk off the threadpool and keeps going past unremovable files, and sweeping the parent directory on each removal cleans up anything stranded by earlier failed deletes.UI Changes
Not applicable.
Checklist