Skip to content

Commit

Permalink
Close race condition window (#623)
Browse files Browse the repository at this point in the history
* Add additional check when reacquiring lock.
  • Loading branch information
bschatz-swift authored May 8, 2021
1 parent baadd2f commit 5bf47fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions retryrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,14 @@ func (client *Client) notifyReply(buf []byte, genNum uint64, recvResponse time.T
client.Unlock()
return
}

_, ok = client.outstandingRequest[crID]
if !ok {
// Saw reply for request which is no longer on outstandingRequest list
// Can happen if handling retransmit
client.Unlock()
return
}
delete(client.outstandingRequest, crID)
client.Unlock()

Expand Down

0 comments on commit 5bf47fd

Please sign in to comment.