Skip to content

test: retry busy unmounts and detach a killed mount - #131

Merged
mattmattox merged 1 commit into
mainfrom
claude/unmount-busy-retry
Nov 14, 2026
Merged

mattmattox merged 1 commit into
mainfrom
claude/unmount-busy-retry

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

The product isn't at fault for TestFsckRepairsOlderSharing failing on .68. The integration harness is.

Results on .68 at main 0b81654 (load about 40):

  • Mounts under /tmp: 5/5 pass.
  • Mounts under $HOME: 0/2. GNOME's localsearch-3 touched the mount, so fusermount -u got EBUSY. MountedFS.Unmount logged it, killed the daemon after 10s, and returned success. The dead mount then made the next Mount time out after 10s, which is the failure the stale-reads session saw. fuser and lsof found no holder by the time they ran, so the indexer's hold is brief.

Unmount now retries fusermount -u while it's busy, for up to 10s. If the mount stays busy, it kills the daemon, detaches the dead mount with fusermount -uz, and returns the error.

Tests on .68 after the fix, mounts under $HOME:

  • TestFsckRepairsOlderSharing: 5/5. Each unmount succeeded after about 110 ms busy.
  • TestDataPersistence: 3/3.
  • -short suite under /tmp: all pass.

I couldn't test on .66: writing a checkout there was denied in my session.

🤖 Generated with Claude Code

MountedFS.Unmount ran fusermount -u once. When anything still used the
mount, for a FUSE release in flight or a desktop indexer crawling it, it
logged the EBUSY, killed the daemon after 10s, and reported success. The
dead mount then made the next Mount at that path time out. On .68 with
mounts under $HOME, GNOME's localsearch kept them busy for about 110 ms,
and TestFsckRepairsOlderSharing failed every run this way.

Unmount now retries fusermount -u while it reports busy, for up to 10s.
If the mount stays busy, it kills the daemon, detaches the dead mount with
fusermount -uz, and returns the error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit f8f6c36 into main Nov 14, 2026
17 checks passed
mattmattox added a commit that referenced this pull request Nov 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox added a commit that referenced this pull request Nov 14, 2026
…per operation (#135)

* perf(alloc): free uncounted blocks under the bitmap lock alone, once per operation

Deletes took the global refcount lock for every file, even for blocks no
snapshot or clone ever shared, and the bitmap lock once per block. With
four nodes deleting, two thirds of their time went to the refcount lock.

A block whose refcount reads 0 under the bitmap lock now goes straight
back to the bitmap. Share is the only runtime code that raises a count,
and it now does so under the bitmap lock too, skipping blocks already
freed, so a zero count cannot change under a free. Counted blocks still
go through Release under the refcount lock, after the bitmap lock is
dropped, since Share takes refcount before bitmap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: keep main's integration helpers (#131)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(alloc): address review notes on the free path

Say what the guard really proves: a zero count read under the bitmap lock
stays zero while the block is freed, not that an allocated block is owned.
Document that Increment, IncrementBatch, Set and SetFlags skip the guard.
HoldAllocated now rejects a block past the end of the volume, so a corrupt
extent fails with EIO instead of retrying, and freeing an already free block
warns again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant