diff options
author | Felix Lange <fjl@twurst.com> | 2016-08-04 08:10:44 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-08-05 19:27:02 +0800 |
commit | 464660651ddf7e8938a0fbb03f140502180a8062 (patch) | |
tree | 0665c2bab40141dd62433ccffcfbcd3d929c08a5 /rpc | |
parent | 3e3a79ea136325102e63e962c122da5b44cd9bd5 (diff) | |
download | go-tangerine-464660651ddf7e8938a0fbb03f140502180a8062.tar.gz go-tangerine-464660651ddf7e8938a0fbb03f140502180a8062.tar.zst go-tangerine-464660651ddf7e8938a0fbb03f140502180a8062.zip |
rpc: don't exceed context deadline while waiting for send lock
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/client.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rpc/client.go b/rpc/client.go index 4ff9a8cb9..0c52402ea 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -398,6 +398,10 @@ func (c *Client) send(ctx context.Context, op *requestOp, msg interface{}) error err := c.write(ctx, msg) c.sendDone <- err return err + case <-ctx.Done(): + // This can happen if the client is overloaded or unable to keep up with + // subscription notifications. + return ctx.Err() case <-c.didQuit: return ErrClientQuit } |