aiohttp.GunicornWebWorker: Unknown child process pid xxx, will report returncode 255 #7038
Open
1 task done
Labels
bug
reproducer: present
This PR or issue contains code, which reproduce the problem described or clearly understandable STR
Describe the bug
The
aiohttp.GunicornWebWorker
leads to problems executing/waiting for subprocesses correctly when usingasyncio
, leading to the wrong exit code being set on subprocesses created throughasyncio.create_subprocess_exec
This might be related to python/cpython#87744
This problem does not arise when using
gunicorn
with a different worker class, e.g.gunicorn --worker-class sync example
It also does not arise when using
python
directly, e.g.python example
The attached reproduction script is just a simple example how to trigger this error, in our server this occurs with other subprocesses which are created in response to HTTP requests coming in through
aiohttp
, after the booting of the workerIf necessary, I can provide another example where an HTTP request triggers this behavior in a running app.
To Reproduce
Execute the python script with
gunicorn
and waitgunicorn --worker-class aiohttp.GunicornWebWorker example
The worker encounters an
asyncio
warningUnknown child process pid xxx, will report returncode 255
Any code that relies on a correct exit code will behave unexpectedly
Expected behavior
The subprocess should reliably finish with exit code
0
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
$ cat /etc/fedora-release
$ uname -a
Related component
Server
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: