I'm unable to reproduce this (Python 3.11.11 on macos, run with `uv
run --with tornado -p 3.11 test.py`). Everything appears to work as
expected to me.
One way I've seen people get in trouble with ProcessPoolExecutor is if
they combine it with Tornado's multi-process mode (without taking care
to initialize things in the proper order) or try to use async
functions in the child process. But you're not doing either in this
example, so everything looks correct to me. (Note that you left a
check_state function here that is not used).
It's possible that creating the ProcessPoolExecutor from inside the
async main function is problematic because the asyncio event loop (and
its thread pool executor?) are already created. This is particularly
likely to be a problem when multiprocessing is run in fork mode (which
is the default on linux but not macos). If you're on linux, try
running `multiprocessing.set_start_method('spawn')` or 'forkserver' at
the start of the `__main__` block to see if that fixes things ('spawn'
is the default on macos; 'forkserver' is going to become the default
on linux in python 3.14. Both of them are safer than 'fork')
-Ben
> --
> You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
python-tornad...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/python-tornado/08d588a5-29ae-4dc4-ab5f-387e153d2692n%40googlegroups.com.