eliot
eliot copied to clipboard
"Exception ignored "
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.
Exception ignored in: <generator object RemoteScannerService._poll_collective at 0x7f0f7cb277b0>
Traceback (most recent call last):
File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_genera$ors.py", line 111, in wrapper
value_out = context.run(go)
File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_genera$ors.py", line 99, in go
value_out = gen.throw(*value_in)
File "/home/meejah/work/leastauthority/src/magic-folder/src/magic_folder/downloader.py", line 518, in _$oll_collective
yield gatherResults([
File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_action$py", line 434, in __exit__
self.finish(exception)
File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_action$py", line 356, in finish
self._logger.write(fields, serializer)
File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_output$py", line 236, in exclusively_f
with self._lock:
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.
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:
- You likely don't need
@inline_callbacks
, Twisted's version should work. It turns out Twisted doescontextvars
for@inlineCallbacks
now... - ... except that there's a bug, fixed by https://github.com/twisted/twisted/pull/1690
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.