9p: add 5s timeout to *wait reads for FUSE signal delivery

FUSE puts blocked processes in D state (uninterruptible sleep) waiting
for the read to return. SIGINT cannot interrupt D-state, so Ctrl+C has
no effect even after Tflush cancels the goroutine. A 5s timeout causes
the read to return periodically, letting FUSE unblock the client process
and deliver any pending signals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-19 17:00:32 +02:00
parent 2f3c11649b
commit 4dd16cb840
1 changed files with 6 additions and 1 deletions

View File

@ -792,7 +792,12 @@ func (s *Server) read(cs *connState, fc *plan9.Fcall, ctx context.Context) *plan
base = f.waitBase
}
cs.mu.RUnlock()
content, err := store.Wait(ctx, parts[2], base)
// Wrap with a short timeout so the FUSE read returns
// periodically, allowing pending signals (e.g. SIGINT) to
// be delivered to the blocked client process.
waitCtx, waitCancel := context.WithTimeout(ctx, 5*time.Second)
defer waitCancel()
content, err := store.Wait(waitCtx, parts[2], base)
if err != nil {
return errFcall(fc, err.Error())
}