Open meejah opened 2 years ago
I can get rid of the first traceback (and see the second more-reliably -- but still not "always") if I decorate the method with just @inlineCallbacks
instead of @inline_callbacks
..
I am not sure how much more effort I'm going to put in to @inline_callbacks
given the ability to switch to async
functions, FWIW, where Eliot contexts should (in theory) just work. Going to test that theory shortly.
After further investigation:
@inline_callbacks
, Twisted's version should work. It turns out Twisted does contextvars
for @inlineCallbacks
now...Twisted 22.8 is now out and includes the fix for twisted/twisted#10301
@meejah if you could retry with latest Twisted and normal inlineCallbacks
? If that works I will likely just update docs to tell users to use Twisted directly.
I tried to "retry", but didn't apparently leave enough hints for future-me to determine how exactly to do that.
I used some code from around the same time (and the line-numbers in the trace at least match up) but I couldn't get the exception to happen again.
I'm seeing this traceback in an
@eliot.twisted.inline_callbacks
-decorated method .. I'm not sure exactly what is happening yet and some initial attempts to re-create the error with a smaller test-case hasn't exhibited the problem.Perhaps this particular test triggers an error, causing some other logging to happen? (The behavior I see is that we're "hung" here, and a ctrl-C gives the above stack .. so could be a deadlock?).
If I remove the two
start_action
calls from that method, the test passes.