forked from TrueCloudLab/frostfs-sdk-go
[#334] rpc: Use DeadlineExceeded error when creating stream failed by timeout
According to https://pkg.go.dev/context#pkg-variables, ContextCancelled should be returned when the context is canceled for some reason other than its deadline passing. So creating gRPC stream with dial timeout fits better for context.DeadlineExceeded. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
7bdc78f2b5
commit
56892e48ac
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ func (c *Client) initInternal(info common.CallMethodInfo, opts ...CallOption) (*
|
|||
if res.stream != nil && res.err == nil {
|
||||
_ = res.stream.CloseSend()
|
||||
}
|
||||
return nil, context.Canceled
|
||||
return nil, context.DeadlineExceeded
|
||||
case res = <-newStreamCh:
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue