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
{{ message }}
Repository navigation
Pathlib throws "Bad file descriptor", but only with uvloop. #414
Update: on 16.0 I no longer get the core dump, but the 'bad file descriptor' persists. I wonder if there's something wrong with my system, is there some way to debug the system side of file descriptors?
Fyi: I don't know if this is related to that issue, but we see similar log entries of Error while closing socket [Errno 9] Bad file descriptor logged by gunicorn in our django setup with gunicorn, uvicorn, uvloop, websockets, when the server is shutting down. Tested with the latest version of uvloop, uvicorn etc.
We are seeing this a lot with asyncio.create_subprocess_exec . Guincorn + uvicorn workers + uvloop+ websockets. Also passing it Path objects and not strings
proc = await asyncio.create_subprocess_exec(
File "/opt/conda/lib/python3.8/asyncio/subprocess.py", line 236, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "uvloop/loop.pyx", line 2793, in subprocess_exec
File "uvloop/loop.pyx", line 2751, in __subprocess_run
File "uvloop/handles/process.pyx", line 597, in uvloop.loop.UVProcessTransport.new
File "uvloop/handles/process.pyx", line 127, in uvloop.loop.UVProcess._init
OSError: [Errno 9] Bad file descriptor
@graingert I can confirm that your one-liner fixes the issue for me as well. I've been running my application for the last few days with your fix, and I haven't had any OSError: [Errno 9] Bad file descriptor since (I had dozens every day before).
Activity
graingert commentedon Jul 13, 2021
Is this fixed by #408 ?
decorator-factory commentedon Jul 13, 2021
Doesn't seem to be, I just tested on 0.15.3, and I get the same results
decorator-factory commentedon Aug 12, 2021
Update: on 16.0 I no longer get the core dump, but the 'bad file descriptor' persists. I wonder if there's something wrong with my system, is there some way to debug the system side of file descriptors?
th3hamm0r commentedon Sep 29, 2021
Fyi: I don't know if this is related to that issue, but we see similar log entries of
Error while closing socket [Errno 9] Bad file descriptorlogged by gunicorn in our django setup with gunicorn, uvicorn, uvloop, websockets, when the server is shutting down. Tested with the latest version of uvloop, uvicorn etc.shughes-uk commentedon May 5, 2022
We are seeing this a lot with
asyncio.create_subprocess_exec. Guincorn + uvicorn workers + uvloop+ websockets. Also passing itPathobjects and not stringsavoid self._errpipe_write double close
graingert commentedon May 11, 2022
@decorator-factory can you try my patch #466 ?
shughes-uk commentedon May 11, 2022
decorator-factory commentedon May 18, 2022
@graingert Yes this fixes it for me. Thanks for finding the issue
cbay commentedon May 19, 2022
@graingert I can confirm that your one-liner fixes the issue for me as well. I've been running my application for the last few days with your fix, and I haven't had any
OSError: [Errno 9] Bad file descriptorsince (I had dozens every day before).Thanks!
avoid self._errpipe_write double close
Avoid self._errpipe_write double close (#466)