Skip to content
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

stack trace when exception occurs in concurrent.futures.ThreadPoolExecutor #49

Open
fictorial opened this issue Feb 9, 2022 · 0 comments

Comments

@fictorial
Copy link

fictorial commented Feb 9, 2022

The stack trace pretty errors outputs is that of the main thread. Say I have a task in a thread pool that raises an AssertionError. pretty errors just outputs "AssertionError".

runpy.py 196 _run_module_as_main
"/Users/me/.asdf/installs/python/3.10.0/lib/python3.10/runpy.py", line 196
return _run_code(code, main_globals, None,



ap_rescheduler.py 179 reschedule_aps
"xxx.py", line 179
new_schedule = future.result()


_base.py 438 result
"/Users/me/.asdf/installs/python/3.10.0/lib/python3.10/concurrent/futures/_base.py", line 438
return self.__get_result()



_base.py 390 __get_result
"/Users/me/.asdf/installs/python/3.10.0/lib/python3.10/concurrent/futures/_base.py", line 390
try:
    raise self._exception
finally:

self: None

AssertionError

Disabling pretty errors temporarily with PYTHON_PRETTY_ERRORS=0 shows a better trace in that it shows me where the assertion failed.

concurrent.futures.process._RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/Users/me/.asdf/installs/python/3.10.0/lib/python3.10/concurrent/futures/process.py", line 243, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "foo.py", line 463, in bar
    assert False
AssertionError

Is there a setting or trick to enable this while using pretty errors? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant