FastAPI versions from 0.111.0 up to but not including 0.139.1 have a vulnerability in the AnyIO process-pool workers where stderr is connected to a pipe but not drained. This can cause the pipe to fill and block indefinitely if the worker writes enough data to stderr, potentially causing a deadlock. The issue is patched in version 0.139.1. A workaround is to close sys.stderr in the target function to prevent deadlock.