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 authored and winglq committed Jan 4, 2025
1 parent 799ccdf commit ede9b40
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 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 @@ -552,22 +551,18 @@ func doCopyFileRange(server *Server, req *request) {

func doInterrupt(server *Server, req *request) {
input := (*InterruptIn)(req.inData)
server.reqMu.Lock()
defer server.reqMu.Unlock()

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

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

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

0 comments on commit ede9b40

Please sign in to comment.