ttrpc: return correct error on (*Client).Close
Because `shutdownErr` will likely be `nil` in the close select branch, returning it to waiters will result in the waiting `(*Client).Call` returning `(nil, nil)`. This should take whatever is set for the client as the exit condition, which is likely to be `ErrClosed`. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
d2710463e4
commit
2c96d0a152
@ -199,7 +199,7 @@ func (c *Client) run() {
|
|||||||
}
|
}
|
||||||
// broadcast the shutdown error to the remaining waiters.
|
// broadcast the shutdown error to the remaining waiters.
|
||||||
for _, waiter := range waiters {
|
for _, waiter := range waiters {
|
||||||
waiter.errs <- shutdownErr
|
waiter.errs <- c.err
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user