-
Notifications
You must be signed in to change notification settings - Fork 4.1k
tracing: additional goroutine per rangefeed #107053
Copy link
Copy link
Closed
Labels
A-kv-rangefeedRangefeed infrastructure, server+clientRangefeed infrastructure, server+clientC-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
Description
In 22.2, we see the number of goroutines per rangefeed increase from 4 to 5. The additional goroutine appears to be this:
1 @ 0x4907d6 0x4a071c 0x1653fb1 0x4c2401
# labels: {"dest_n":"1", "dest_r":"1012", "dest_s":"1", "distsql.gateway":"1", "f":"c975f0f6", "job":"883416806392332289", "n":"1"}
# 0x1653fb0 github.com/cockroachdb/cockroach/pkg/util/tracing/grpcinterceptor.newTracingClientStream.func2+0x70 github.com/cockroachdb/cockroach/pkg/util/tracing/grpcinterceptor/grpc_interceptor.go:340
Which comes from here:
cockroach/pkg/util/tracing/grpcinterceptor/grpc_interceptor.go
Lines 348 to 362 in 00fd3ef
| go func() { | |
| select { | |
| case <-finishChan: | |
| // The client span is being finished by another code path; hence, no | |
| // action is necessary. | |
| case <-ctx.Done(): | |
| // A streaming RPC can be finished by the caller cancelling the ctx. If | |
| // the ctx is cancelled, the caller doesn't necessarily need to interact | |
| // with the stream anymore (see [1]), so finishChan might never be | |
| // signaled). Thus, we listen for ctx cancellation and finish the span. | |
| // | |
| // [1] https://pkg.go.dev/google.golang.org/grpc#ClientConn.NewStream | |
| finishFunc(nil /* err */) | |
| } | |
| }() |
I believe this may have been introduced by #76306.
Jira issue: CRDB-29858
Epic CRDB-26372
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-kv-rangefeedRangefeed infrastructure, server+clientRangefeed infrastructure, server+clientC-performancePerf of queries or internals. Solution not expected to change functional behavior.Perf of queries or internals. Solution not expected to change functional behavior.O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docsWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs