Skip to content

Commit

Permalink
don't retry interrupt on lost requests
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Dec 30, 2024
1 parent 6a2a137 commit 1c4d29e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fuse/opcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"runtime"
"runtime/debug"
"syscall"
"time"
"unsafe"
)

Expand Down Expand Up @@ -539,24 +538,18 @@ func doCopyFileRange(server *Server, req *request) {
func doInterrupt(server *Server, req *request) {
input := (*InterruptIn)(req.inData)

// This is slow, but this operation is rare.
server.reqMu.Lock()
for _, inflight := range server.reqInflight {
if input.Unique == inflight.inHeader.Unique {
if !inflight.interrupted {
close(inflight.cancel)
inflight.interrupted = true
}
server.reqMu.Unlock()
req.status = OK
return
}
}
server.reqMu.Unlock()

// not found; wait for a bit
time.Sleep(10 * time.Microsecond)
req.status = EAGAIN
req.status = OK
}

////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 1c4d29e

Please sign in to comment.