You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use @trace_and_save on a function that runs in a separate thread (using multiprocessing.Pool), I get the following error
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/home/acarter/.local/lib/python3.10/site-packages/viztracer/decorator.py", line 49, in wrapper
tracer.fork_save(file_name)
File "/home/acarter/.local/lib/python3.10/site-packages/viztracer/viztracer.py", line 254, in fork_save
p.start()
File "/usr/lib/python3.10/multiprocessing/process.py", line 118, in start
assert not _current_process._config.get('daemon'), \
AssertionError: daemonic processes are not allowed to have children
I think this is because VizTracer tries to do it's thing in a new process in a new process to minimize performance impacts (docs), but you can't start a new process pool from within one (or something like that). Perhaps there could be an option for @trace_and_save to do the VizTracer work in the same process? I'd be happy to work on this
The text was updated successfully, but these errors were encountered:
Sure, if you want to work on this, you can add an extra argument fork_save=True to@trace_and_save. The user can set it to False if they want to save the trace on the same process.
Just make sure you write the test for it to keep the 100% coverage rate :)
When trying to use
@trace_and_save
on a function that runs in a separate thread (using multiprocessing.Pool), I get the following errorI think this is because VizTracer tries to do it's thing in a new process in a new process to minimize performance impacts (docs), but you can't start a new process pool from within one (or something like that). Perhaps there could be an option for
@trace_and_save
to do the VizTracer work in the same process? I'd be happy to work on thisThe text was updated successfully, but these errors were encountered: