aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-08-04 08:10:44 +0800
committerFelix Lange <fjl@twurst.com>2016-08-05 19:27:02 +0800
commit464660651ddf7e8938a0fbb03f140502180a8062 (patch)
tree0665c2bab40141dd62433ccffcfbcd3d929c08a5 /rpc
parent3e3a79ea136325102e63e962c122da5b44cd9bd5 (diff)
downloaddexon-464660651ddf7e8938a0fbb03f140502180a8062.tar.gz
dexon-464660651ddf7e8938a0fbb03f140502180a8062.tar.zst
dexon-464660651ddf7e8938a0fbb03f140502180a8062.zip
rpc: don't exceed context deadline while waiting for send lock
Diffstat (limited to 'rpc')
-rw-r--r--rpc/client.go4
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
}