From b8474db57b11abb0e0dcb15082aa33db1c786f9c Mon Sep 17 00:00:00 2001 From: Roman Golov Date: Thu, 18 Apr 2024 21:40:33 +0300 Subject: [PATCH 1/3] Fix data race in grpc Client stream. --- CHANGELOG.md | 2 ++ internal/conn/grpc_client_stream.go | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c5bd059a..ab9c9c2d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Fixed data race in `grpcClientStream` + ## v3.65.2 * Fixed data race using `log.WithNames` diff --git a/internal/conn/grpc_client_stream.go b/internal/conn/grpc_client_stream.go index 32377e5ab..96ab744fc 100644 --- a/internal/conn/grpc_client_stream.go +++ b/internal/conn/grpc_client_stream.go @@ -25,7 +25,8 @@ type grpcClientStream struct { } func (s *grpcClientStream) CloseSend() (err error) { - onDone := trace.DriverOnConnStreamCloseSend(s.c.config.Trace(), &s.ctx, + ctx := s.ctx + onDone := trace.DriverOnConnStreamCloseSend(s.c.config.Trace(), &ctx, stack.FunctionID("github.com/ydb-platform/ydb-go-sdk/3/internal/conn.(*grpcClientStream).CloseSend"), ) defer func() { @@ -59,7 +60,8 @@ func (s *grpcClientStream) CloseSend() (err error) { } func (s *grpcClientStream) SendMsg(m interface{}) (err error) { - onDone := trace.DriverOnConnStreamSendMsg(s.c.config.Trace(), &s.ctx, + ctx := s.ctx + onDone := trace.DriverOnConnStreamSendMsg(s.c.config.Trace(), &ctx, stack.FunctionID("github.com/ydb-platform/ydb-go-sdk/3/internal/conn.(*grpcClientStream).SendMsg"), ) defer func() { @@ -101,7 +103,8 @@ func (s *grpcClientStream) SendMsg(m interface{}) (err error) { } func (s *grpcClientStream) RecvMsg(m interface{}) (err error) { - onDone := trace.DriverOnConnStreamRecvMsg(s.c.config.Trace(), &s.ctx, + ctx := s.ctx + onDone := trace.DriverOnConnStreamRecvMsg(s.c.config.Trace(), &ctx, stack.FunctionID("github.com/ydb-platform/ydb-go-sdk/3/internal/conn.(*grpcClientStream).RecvMsg"), ) defer func() { @@ -114,7 +117,7 @@ func (s *grpcClientStream) RecvMsg(m interface{}) (err error) { defer func() { if err != nil { md := s.ClientStream.Trailer() - s.onDone(s.ctx, md) + s.onDone(ctx, md) } }() From ecc181139d2a3e2d894943be35ae2f23e6a3efa2 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Thu, 18 Apr 2024 23:48:54 +0300 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab9c9c2d9..796256177 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -* Fixed data race in `grpcClientStream` +* Fixed data race in `internal/conn.grpcClientStream` ## v3.65.2 * Fixed data race using `log.WithNames` From 75ccf7e44a58aa46fd65c27d97a03bf9927d1abf Mon Sep 17 00:00:00 2001 From: robot Date: Thu, 18 Apr 2024 20:55:06 +0000 Subject: [PATCH 3/3] Release v3.65.3 --- CHANGELOG.md | 1 + internal/version/version.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 796256177..a24369100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +## v3.65.3 * Fixed data race in `internal/conn.grpcClientStream` ## v3.65.2 diff --git a/internal/version/version.go b/internal/version/version.go index 1238601f4..d89575acc 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -3,7 +3,7 @@ package version const ( Major = "3" Minor = "65" - Patch = "2" + Patch = "3" Prefix = "ydb-go-sdk" )