Repository navigation
fix(fs): finish operations whose FUSE request is interrupted - #45
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The kernel sends FUSE_INTERRUPT whenever the calling process gets a signal, and Go programs signal themselves for preemption all the time. go-fuse cancels the request context, lock.Acquire gives up, and the operation returned EIO, after side effects such as a committed journal intent. Every FUSE handler now runs on a context that interrupts do not cancel, so the operation finishes. Honoring an interrupt with EINTR would need rollback of partial work, breaks retries of unlink, rmdir and O_EXCL create, and C programs rarely retry it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
File operations ignore interrupts like an NFS hard mount; a lock wait that cannot finish fails with EIO after DefaultTimeout (from #29). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Statfs, Getattr, Open, Read and Fsync never use their context, so they cannot wait on a lock; ineffassign flagged the dead assignment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 10, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 10, 2026
) Acquire ended a wait only when the caller's context was done. A FUSE handler that detaches its context from request interrupts (#45) would then wait forever on a lock that is never released. Acquire now also gives up after DefaultTimeout (30s), and logs at WARN the lock key and the record's holder, mode and age, so operators can see which node held it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox
added a commit
that referenced
this pull request
Nov 13, 2026
Since #45 an interrupted FUSE create finishes instead of failing with EIO, so TestMultiNodeConcurrentCreatesDoNotCollide no longer needs its EIO retry. It now also checks that each node reads every file the other node created, with the right content. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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.
FUSE handlers that pass their context on now run on
context.WithoutCancel(ctx). A signal to the calling process (for Go programs, the runtime's preemption SIGURG) no longer cancels the request context. On main,lock.Acquirestill ends its wait when the context is cancelled, so that signal turned ordinary creates and writes into EIO. Lock waits are still bounded: #54 gives up after 30s (DefaultTimeout) and logs the lock and its holder at WARN, and the op then fails with EIO.I didn't return EINTR, and the PM approved that. Create commits its journal intent before its first lock wait, so an EINTR would need intent rollback. Retries of unlink, rmdir and
O_EXCLcreate fail (ENOENT, EEXIST) once the first attempt is past its point of no return. C programs rarely retry EINTR. go-fuse documents honoring an interrupt as optional. OPERATIONS.md and TROUBLESHOOTING.md now say file operations ignore interrupts like an NFS hard mount, that SIGKILL still works, and that a stuck lock wait fails with EIO after 30s with a[WARN] lock: gave up waitingline naming the holder.Tests:
TestWriteFinishesAfterInterruptDuringLockWait(unit, two in-process nodes): fails on 409a89f, where Write returned EIO.TestMultiNodeCreateWithSignals(tgkill SIGURG to the creating threads): fails on 409a89f, with EIO in 3 of 3 runs.TestWriteFailsWhenLockIsNotFreed(unit): node A keeps a busy hold, and node B's interrupted Write returns EIO after about 31s.Tested on .68 at 8248fd9:
-shortintegration: 118 pass, 18 skip, 0 fail.TestMultiNodeConcurrentDirectoryOpspassed 50 of 50, at ee01dbc.🤖 Generated with Claude Code