Skip to content

Commit

Permalink
Fix data race in connect client (#800)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
  • Loading branch information
Vladimir Popov authored Mar 31, 2021
1 parent 2e26c2a commit 964332c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/networkservice/common/connect/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ func (u *connectClient) init() error {
ctx, cancel := context.WithTimeout(u.ctx, u.dialTimeout)
defer cancel()

dialOptions := append(append([]grpc.DialOption{}, u.dialOptions...), grpc.WithReturnConnectionError())

var cc *grpc.ClientConn
cc, u.dialErr = grpc.DialContext(ctx, grpcutils.URLToTarget(clientURL), append(u.dialOptions, grpc.WithReturnConnectionError())...)
cc, u.dialErr = grpc.DialContext(ctx, grpcutils.URLToTarget(clientURL), dialOptions...)
if u.dialErr != nil {
return
}
Expand Down

0 comments on commit 964332c

Please sign in to comment.