-
Notifications
You must be signed in to change notification settings - Fork 77
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
[Bug] GeneratorExit possibly causing issues on context detach in OTel finally #441
Comments
Is there any workaround for this? We have tons of these errors in our logs forcing us to disable tracing in our workers. |
I am not aware of an obvious one (see linked upstream ticket). We may be able to make sure everywhere we However, we have found that I wouldn't be surprised if this is some OpenTelemetry users' issue too - |
@cretz As I commented on #2606 I was able to work around a similar issue. Feel free to contact me if you are interested in more details. I suspect that if the otel teardown_request hook "opentelemetry-flask.activation_key" could somehow know that it was not in the correct context (e.g. on the wrong thread, or different async context) and therefore decide to do nothing, this might resolve the issue. |
Hey @benliddicott I've been following this issue for python-otel, and put out a flask-specific fix awhile back: open-telemetry/opentelemetry-python-contrib#1692. Since you're still recently having issues, I'm imagining that didn't resolve it for you (unless you're on an old version?) Maybe the changes / PR desc could be helpful debugging your issue? |
For the Temporal SDK here in this GH issue, we don't even use Flask. The GC can wake up the coroutine in any thread, including the same one it may have started in but is currently being used for something else by the thread pool. There's not much you can do but avoid letting coroutines/generators get GC'd (i.e. cancel and wait for graceful completion). |
Ya sorry about the flask noise, probably better to post what I did back in open-telemetry/opentelemetry-python#2606 I'm now on a new project where we're running into the same error, and it's moreso related to generators/coroutines that you are mentioning; that's why I'm also following this thread |
No prob, yeah I flat out could not find a good solution besides not ever reaching So that's how we solved this, just making sure all tasks complete (but leaving open until we release it) |
@matthewgrossman I am not having issues, as I have a workaround, as described in open-telemetry/opentelemetry-python#2606 (comment) so there is no urgency from my side. @cretz I haven't tried to find out if my workaround is still necessary in the latest release - all I can say is that the version we are using hasn't broken the workaround. |
@benliddicott would you be available to share the code you used as a solution to this? I am running into the same issue as well. |
Describe the bug
Reports of:
There are outstanding issues like open-telemetry/opentelemetry-python#2606 that may be related.
The text was updated successfully, but these errors were encountered: