diff --git a/client/client.go b/client/client.go index 4a4d77f..d2aabf1 100644 --- a/client/client.go +++ b/client/client.go @@ -198,6 +198,14 @@ func handleRPC(c *client) { } } + for _, cs := range pendingRequests { + atomic.AddUint32(&c.pendingRequestsCount, ^uint32(0)) + cs.Error = err + if cs.DoneChan != nil { + cs.done() + } + } + } func rpcWriter(c *client, pendingRequests map[interface{}]*CallState, pendingRequestsLock *sync.Mutex, stopChan <-chan struct{}, writerDone chan<- error) {