Skip to content

tracing: additional goroutine per rangefeed #107053

@erikgrinaker

Description

@erikgrinaker

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:

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

Metadata

Metadata

Assignees

Labels

A-kv-rangefeedRangefeed infrastructure, server+clientC-performancePerf of queries or internals. Solution not expected to change functional behavior.O-supportWould prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions