Repository navigation
Stop the fsmonitor orphan sweep killing submodule daemons - #4729
Merged
Merged
Conversation
Class-2 orphans were any daemon whose git-dir sat under the repo's git-common-dir without being a live worktree's git-dir. Submodule git-dirs live at <common-dir>/modules/<name>, which `git worktree list` never reports, so with core.fsmonitor=true every sweep (wt remove, wt merge) SIGTERMed the daemons serving live submodules. Restrict class 2 to the git-dirs this repo's worktrees use: the common dir itself and <common-dir>/worktrees/<name>.
Merged
max-sixty
added a commit
that referenced
this pull request
Nov 14, 2026
Prepares Worktrunk 0.82.0, including release notes, contributor credits, and the minor version bump required by Rust library API changes. Protects active temporary indexes from concurrent stale-file cleanup with an owner lock, preserving forced-removal backups. Restores v0.81.0's daemon-backed removal check and cached macOS fsmonitor startup configuration, as explicitly [approved by the maintainer](#4716 (comment)): the unshipped post-shutdown full scan from #4456 is removed. The separate fix that spares live submodule daemons during orphan cleanup (#4729) remains. Includes current main through `0df653384`, corrected plugin documentation, and regenerated mirrors. Independent review covered the rollback, all intervening main changes, and all 30 changelog entries. Local validation passed 5,502 tests (one skipped), doctests, documentation checks, and 21 built-site tests. Full cross-platform validation and all PR checks, including patch coverage, passed. Tagging awaits explicit sign-off on the full adjudicated release safety review. > _This was written by Codex on behalf of max-sixty_
1 task
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.
The orphan fsmonitor sweep that runs after
wt removeandwt merge(run_internal_sweep→reap_orphan_fsmonitor_daemons→classify_orphans) treated any daemon as a class-2 orphan when its git-dir sat under the repo's git-common-dir but wasn't a live worktree's git-dir. Submodule git-dirs also live under the common dir, at.git/modules/<name>, andgit worktree listnever reports them. So withcore.fsmonitor=trueset globally, every sweep sent SIGTERM and then SIGKILL to the daemons serving live submodules. That breaks the module's own rule that a daemon serving a live checkout is never reaped. Git respawns the daemon on the next command, so the damage is a lost cache, not lost data.This PR limits class 2 to the git-dirs this repo's own worktrees use: the common dir itself, and
<common-dir>/worktrees/<name>. Everything else nested in the common dir is spared, the same way daemons for other repositories already are.classifies_each_orphan_class_and_spares_othersnow also has a submodule daemon and a daemon for a submodule's linked worktree. Under the oldstarts_withcheck, both would have been selected. Locally, the fsmonitor unit tests and clippy pass. The one other failure,start_fsmonitor_daemon_skips_fork_when_daemon_answers, also fails onmainhere, because this sandbox blocksAF_UNIXsockets.Found during the nightly survey by reading the code, not from a user report.