Compare commits

..

1 commit

Author SHA1 Message Date
cbc59f82fb [#301] rpc: Make client stream initialization get cancelled by dial timeout
All checks were successful
DCO / DCO (pull_request) Successful in 1m17s
Tests and linters / Tests (pull_request) Successful in 1m35s
Tests and linters / Lint (pull_request) Successful in 1m52s
* `c.conn` may be already invalidated but the rpc client can't detect this.
  `NewStream` may hang trying to open a stream with invalidated connection.
  Using timer with `dialTimeout` for `NewStream` fixes this problem.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-12-06 10:22:50 +03:00

View file

@ -80,7 +80,6 @@ func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageRe
case <-newStreamCh:
default:
cancel()
<-newStreamCh
return nil, context.Canceled
}
case <-newStreamCh: