-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
otelgrpc: goroutine leak if Recv is not called #502
Comments
opentelemetry-go-contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go Lines 186 to 196 in e532370
It seems no goroutine will leak because of no |
Yes, but if we look at this: opentelemetry-go-contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go Lines 214 to 229 in e532370
we can see that return will happen if we get errorEvent OR (closeEvent AND receiveEndEvent ).You are right, we can get CloseEvent from CloseSend() , but ReceiveEndEvent will never happen if we don't call RecvMsg .Maybe the condition should be like this:
Correct me if I am wrong |
@glazychev-art You're right that goroutine will leak if we don't call Also, |
@XSAM Is it possible to wait for
|
@denis-tingaikin It might not be a solution here since the context can't be called before
https://github.com/grpc/grpc-go/blob/577eb696279ea85069a02c9a4c2defafdab858c5/stream.go#L93-L97 |
This issue still actual. Moreover, it is not reproducible if we are using jaeger directly. |
@denis-tingaikin I can't reproduce this bug. What version of the |
The `go.opentelemetry.io/otel/exporter/trace/jaeger` package was mistakenly released with a `v1.0.0` tag instead of `v0.1.0`. This resulted in all subsequent releases not becoming the default latest, meaning that `go get`s pulled in the incompatible `v0.1.0` release of that package when pulling in more recent packages from other otel packages. Renaming the `exporter` directory to `exporters` fixes this issue by consequentially renaming the package. Additionally, this action also renames *all* exporters. This is understood to be a disruptive action to existing users as they will need to update any dependencies they currently have on our exporters. However, it was decided to take this action regardless. The need to resolve the existing issue explained above is highly important, and given the Alpha state of this project these kinds of breaking changes should be expected (though not without reason). Resolves #331 Co-authored-by: Rahul Patel <rghetia@yahoo.com>
It seems it has been fixed - #840 |
Hello,
This problem is related to StreamClientInterceptor.
The goroutine is creating inside
wrapClientStream
and it is waiting for events (ex. fromRecvMsg
)https://github.com/open-telemetry/opentelemetry-go-contrib/blob/master/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go#L279-L280
What if we create
clientStream
and never callstream.Recv()
? Seems there will be a goleak, because goroutine is waiting for events to quit.Thank you
The text was updated successfully, but these errors were encountered: