Closed itamarst closed 5 years ago
This is broken. I need to switch to using just ContextVar.set/get, without managing our own stack; the latter is no longer necessary. And tests to demonstrate the problems I saw with Trio example.
Should in theory work now, modulo minor fixes.
@jtrakk would appreciate some testing, if you have the time.
I'm not sure what's supposed to happen if I continue an action in a subprocess (trio.Process
) and an exception is raised inside that subprocess.
[...]
File "/usr/lib/python3.7/contextlib.py", line 511, in __exit__
raise exc_details[1]
File "/usr/lib/python3.7/contextlib.py", line 496, in __exit__
if cb(*exc_details):
File "/usr/lib/python3.7/contextlib.py", line 377, in _exit_wrapper
return cm_exit(cm, exc_type, exc, tb)
File "/home/user/Documents/project/venv/lib/python3.7/site-packages/eliot/_action.py", line 414, in __exit__
_ACTION_CONTEXT.reset(self._parent_token)
ValueError: <Token var=<ContextVar name='eliot.action' at 0x7f51b550c048> at 0x7f51b3f631f8> was created in a different Context
Could you share a minimal reproducer? Thanks!
The issue was due to my broken dual-purpose logging decorator implementation. I'll keep poking around and will update if I experience problems.
Fixes #290 Fixes #396