Fail loudly on a touch read, stop the workers before their sockets close, and file down the small edges
This commit is contained in:
@@ -170,10 +170,13 @@ func (p *probeSender) awaitTx(scratch, oob []byte) (int64, bool) {
|
||||
fds := []unix.PollFd{{Fd: int32(p.fd), Events: unix.POLLERR}}
|
||||
deadline := time.Now().Add(probeTimeout)
|
||||
for {
|
||||
ms := int(time.Until(deadline).Milliseconds())
|
||||
if ms <= 0 {
|
||||
left := time.Until(deadline)
|
||||
if left <= 0 {
|
||||
return 0, false
|
||||
}
|
||||
// Rounded up, since truncating would give up with time still on the
|
||||
// clock and shave the last fraction of a millisecond off every wait.
|
||||
ms := int((left + time.Millisecond - 1) / time.Millisecond)
|
||||
n, err := unix.Poll(fds, ms)
|
||||
if err == unix.EINTR {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user