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
I had already observed interferences between Textual and multiprocessing.Process before, those occurred when using threaded workers (see here), so maybe there is a deeper rooted issue with multiprocessing.Process in Textual?
This here is about a different issue with multiprocessing.Process. No threads are involved!
Running this without textual-serve, like python mwe.py or python -m mwe, yields the following output:
-- 1 --
-- 2 --
-- 3 --
-- 4 --
However, running the same example with textual-serve, like python test.py --web, yields a different output:
-- 1 --
-- 2 --
-- 3 --
So obviously, when running the MWE with textual-serve, the execution gets stuck on p.join(), meaning that p.terminate() didn't work properly. The obvious workaround is to add p.kill() after the p.terminate() line, however, the behavior of the code shouldn't diverge based on whether textual-serve is being used or not, right?
The text was updated successfully, but these errors were encountered:
kostrykin
changed the title
multiprocessing.Process.terminate not working properly with textual-servemultiprocessing.Process.terminate not working with textual-serve
Aug 23, 2024
I had already observed interferences between Textual and
multiprocessing.Process
before, those occurred when using threaded workers (see here), so maybe there is a deeper rooted issue withmultiprocessing.Process
in Textual?This here is about a different issue with
multiprocessing.Process
. No threads are involved!Consider the following MWE:
Lets say the above is stored in
mwe.py
.Running this without textual-serve, like
python mwe.py
orpython -m mwe
, yields the following output:However, running the same example with textual-serve, like
python test.py --web
, yields a different output:So obviously, when running the MWE with textual-serve, the execution gets stuck on
p.join()
, meaning thatp.terminate()
didn't work properly. The obvious workaround is to addp.kill()
after thep.terminate()
line, however, the behavior of the code shouldn't diverge based on whether textual-serve is being used or not, right?The text was updated successfully, but these errors were encountered: