- Notifications
You must be signed in to change notification settings - Fork 600
Description
Here's the code to reproduce those issues:
importuvloopfromasyncioimportset_event_loop_policy, create_subprocess_shell, gather, get_event_loopfromasyncio.subprocessimportPIPEasyncdefrun_cmd(): length=1000000process=awaitcreate_subprocess_shell("head -c %s /dev/urandom"%length, stdout=PIPE) output, err=awaitprocess.communicate() assertlen(output) ==lengthset_event_loop_policy(uvloop.EventLoopPolicy()) loop=get_event_loop() loop.set_debug(True) runners= [run_cmd() foriinrange(50)] loop.run_until_complete(gather(*runners))The exact runtime error raised depends on where I run it:
This raises multiple RuntimeError: Cannot pause_reading() when closing:
- uvloop version: 0.8.0
- Python version: 3.6.1
- Platform: linux 4.7.8-1 i686 pae, backport, Debian 8
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: yes
On the same system with python 3.5.3 this runtime error isn't raised but the assertion fails.
This raises multiple exceptions such as RuntimeError: unable to perform operation on <ReadUnixTransport closed=True reading=False 0x7efe0d848d00> the handler is closed when using /dev/zero instead of /dev/urandom and only needs 2 parallel subprocesses (1 works):
- uvloop version: 0.8.0
- Python version: 3.6.1
- Platform: linux 3.16.0-4-amd64, Debian 8
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: yes
It also raises multiple times RuntimeError: Cannot pause_reading() when closing if run_cmd is launched 200 times instead of 50. Note that this system is on a server with 16G of RAM, while the first one only has 4G (if that makes any difference).
Running the same code with asyncio's default loop works in any case.