From e7af1ba51fd06563f32a89fddf9a77260f5203a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 01:35:00 +0000 Subject: [PATCH] chore(deps): update github.com/charleskorn/go-grpc digest to 73cb765 --- go.mod | 2 +- go.sum | 4 ++-- .../opentracing-contrib/go-grpc/client.go | 21 ++++++++----------- vendor/modules.txt | 4 ++-- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 3031f027b8b..91b7c94ecd8 100644 --- a/go.mod +++ b/go.mod @@ -273,4 +273,4 @@ replace github.com/munnerz/goautoneg => github.com/grafana/goautoneg v0.0.0-2023 replace github.com/opentracing-contrib/go-stdlib => github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956 // Replace opentracing-contrib/go-grpc with a fork until https://github.com/opentracing-contrib/go-grpc/pull/16 is merged. -replace github.com/opentracing-contrib/go-grpc => github.com/charleskorn/go-grpc v0.0.0-20231024023642-e9298576254f +replace github.com/opentracing-contrib/go-grpc => github.com/charleskorn/go-grpc v0.0.0-20210225150812-73cb765af46e diff --git a/go.sum b/go.sum index 45929264dba..a4594957fa6 100644 --- a/go.sum +++ b/go.sum @@ -177,8 +177,8 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charleskorn/go-grpc v0.0.0-20231024023642-e9298576254f h1:P1GSPnbxmhUafKGBcaY2qqx34mBdC4GVDm/RN3iKKuE= -github.com/charleskorn/go-grpc v0.0.0-20231024023642-e9298576254f/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= +github.com/charleskorn/go-grpc v0.0.0-20210225150812-73cb765af46e h1:Ks8NKfXt/jfli5vHJOcY9cqJHAVBqksEZUQZx60gyFw= +github.com/charleskorn/go-grpc v0.0.0-20210225150812-73cb765af46e/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= github.com/chromedp/cdproto v0.0.0-20210526005521-9e51b9051fd0/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= github.com/chromedp/cdproto v0.0.0-20210706234513-2bc298e8be7f/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= github.com/chromedp/cdproto v0.0.0-20230802225258-3cf4e6d46a89 h1:aPflPkRFkVwbW6dmcVqfgwp1i+UWGFH6VgR1Jim5Ygc= diff --git a/vendor/github.com/opentracing-contrib/go-grpc/client.go b/vendor/github.com/opentracing-contrib/go-grpc/client.go index d764506717b..c9496c85aff 100644 --- a/vendor/github.com/opentracing-contrib/go-grpc/client.go +++ b/vendor/github.com/opentracing-contrib/go-grpc/client.go @@ -124,11 +124,15 @@ func OpenTracingStreamClientInterceptor(tracer opentracing.Tracer, optFuncs ...O clientSpan.Finish() return cs, err } - return newOpenTracingClientStream(ctx, cs, method, desc, clientSpan, otgrpcOpts), nil + return newOpenTracingClientStream(cs, method, desc, clientSpan, otgrpcOpts), nil } } -func newOpenTracingClientStream(ctx context.Context, cs grpc.ClientStream, method string, desc *grpc.StreamDesc, clientSpan opentracing.Span, otgrpcOpts *options) grpc.ClientStream { +func newOpenTracingClientStream(cs grpc.ClientStream, method string, desc *grpc.StreamDesc, clientSpan opentracing.Span, otgrpcOpts *options) grpc.ClientStream { + // Grab the client stream context because when the finish function or the goroutine below will be + // executed it's not guaranteed cs.Context() will be valid. + csCtx := cs.Context() + finishChan := make(chan struct{}) isFinished := new(int32) @@ -148,7 +152,7 @@ func newOpenTracingClientStream(ctx context.Context, cs grpc.ClientStream, metho SetSpanTags(clientSpan, err, true) } if otgrpcOpts.decorator != nil { - otgrpcOpts.decorator(ctx, clientSpan, method, nil, nil, err) + otgrpcOpts.decorator(csCtx, clientSpan, method, nil, nil, err) } } go func() { @@ -156,15 +160,8 @@ func newOpenTracingClientStream(ctx context.Context, cs grpc.ClientStream, metho case <-finishChan: // The client span is being finished by another code path; hence, no // action is necessary. - case <-ctx.Done(): - // Why use ctx rather than cs.Context()? Two reasons: - // 1. According to its docs, cs.Context() should not be used until after the first Header() or - // RecvMsg() call has returned. - // 2. ClientStream implementations cancel their context as soon as an error is received in Header(), - // RecvMsg(), SendMsg() or CloseSend(). This causes a race between the interceptor logging the - // returned error and this method logging the cancelled context. - // Using ctx avoids both of these issues. - finishFunc(ctx.Err()) + case <-csCtx.Done(): + finishFunc(csCtx.Err()) } }() otcs := &openTracingClientStream{ diff --git a/vendor/modules.txt b/vendor/modules.txt index a43d53e7bc9..57b320c772d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -786,7 +786,7 @@ github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometh # github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.84.0 ## explicit; go 1.20 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite -# github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e => github.com/charleskorn/go-grpc v0.0.0-20231024023642-e9298576254f +# github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e => github.com/charleskorn/go-grpc v0.0.0-20210225150812-73cb765af46e ## explicit; go 1.11 github.com/opentracing-contrib/go-grpc # github.com/opentracing-contrib/go-stdlib v1.0.0 => github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956 @@ -1475,4 +1475,4 @@ sigs.k8s.io/yaml # github.com/grafana/regexp => github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6 # github.com/munnerz/goautoneg => github.com/grafana/goautoneg v0.0.0-20231010094147-47ce5e72a9ae # github.com/opentracing-contrib/go-stdlib => github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956 -# github.com/opentracing-contrib/go-grpc => github.com/charleskorn/go-grpc v0.0.0-20231024023642-e9298576254f +# github.com/opentracing-contrib/go-grpc => github.com/charleskorn/go-grpc v0.0.0-20210225150812-73cb765af46e