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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-09-13.11:57:12.834>created_at=<Date2019-09-11.10:12:22.124>labels= ['type-crash', 'expert-asyncio']
title='File descriptor error when subprocess call is used with event loop enabled in main thread'updated_at=<Date2019-09-13.11:57:12.833>user='https://bugs.python.org/ManojC'
Now when I use a normal subprocess call in the main thread, I start getting following file descriptor error after few iterations:
Exception ignored when trying to write to the signal wakeup fd:
BlockingIOError: [Errno 11] Resource temporarily unavailable
I have reproduced the problem in a small script and am seeing that the error goes away if I do not start the even loop in the main thread.
import asyncio
import subprocess
import time
def try_error():
for i in range(1,500):
print(i)
try:
subprocess.run(["ls", "-l"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except subprocess.CalledProcessError as e:
print(f"Exception raised {e.stderr}\nOutput {e.stdout}")
def definite_error():
w = asyncio.get_child_watcher()
l = asyncio.get_event_loop()
try_error()
if __name__ == "__main__":
definite_error()
This is the smallest subset of the code which can reproduce the error. In the original code, I run a asyncio.create_subprocess_exec in a parallel thread. The normal subprocess call is part of third party code which call from the main thread and hence cannot modify it.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: