Repository navigation
Pathlib throws "Bad file descriptor", but only with uvloop. #414
Description
Activity
Is this fixed by #408 ?
Is this fixed by #408 ?
Doesn't seem to be, I just tested on 0.15.3, and I get the same results
Reacted by Gnome!Reacted by Thomas GraingerUpdate: 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 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.We are seeing this a lot with
asyncio.create_subprocess_exec. Guincorn + uvicorn workers + uvloop+ websockets. Also passing itPathobjects and not stringsproc = 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- added a commit that references this issue
on May 11, 2022 @decorator-factory can you try my patch #466 ?
- Yes I’ll putt this through it’s paces and report back…On Wed, May 11, 2022 at 3:24 AM Thomas Grainger ***@***.***> wrote: @decorator-factory <https://github.com/decorator-factory> can you try my patch #466 <#466> ? — Reply to this email directly, view it on GitHub <#414 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAEFQS5DKW7J6FUMDT7CR6TVJODFRANCNFSM45KX23UA> . You are receiving this because you commented.Message ID: ***@***.***>
@graingert Yes this fixes it for me. Thanks for finding the issue
@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!
- added a commit that references this issue
on Jul 16, 2022 - added a commit that references this issue
on Jul 17, 2022
PYTHONASYNCIODEBUGin env?: nouvloop, the script works just fine.When spawning processes and creating file, an
OSError: [Errno 9] Bad file descriptorsometimes appears.Script and output: https://gist.github.com/decorator-factory/6b5276ab5fb87f4c009f1d22dc4b20a9
Sometimes it also just hangs, with 0 CPU consumption. When I press CTRL+C, I get this traceback: https://gist.github.com/decorator-factory/888a584cbc4d44600ea62f5e7e344b66
Sometimes it completes successfully.