Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
rpc/client: Dial with grpc.WithReturnConnectionError option
Browse files Browse the repository at this point in the history
Since 2b89b7e, RPC client used
`grpc.WithBlock` option to dial the server. This option make dialer to
return either `nil` or `context.DeadlineExceeded` errors, with any
connection error resulting in the latter. In particular, TLS handshake
failures were shadowed by deadline error.

Now `WithReturnConnectionError` option is used instead:
 * it still blocks similar to `WithBlock`;
 * it adds connection failure to the deadline error.

As a result, TLS unit test passes now. This should fix the problem
originally posted in nspcc-dev/neofs-node#2561.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Feb 28, 2024
1 parent 6cca5d1 commit 05ac62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpc/client/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (c *Client) openGRPCConn(ctx context.Context, extraDialOpts ...grpcstd.Dial
dialOpts := make([]grpcstd.DialOption, 0, 2+len(extraDialOpts))
dialOpts = append(dialOpts,
grpcstd.WithTransportCredentials(creds),
grpcstd.WithBlock(),
grpcstd.WithReturnConnectionError(),
)
if extraDialOpts != nil {
dialOpts = append(dialOpts, extraDialOpts...)
Expand Down

0 comments on commit 05ac62e

Please sign in to comment.