[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-12-05 Thread Marko
Marko added the comment: Thanks, takluyver! You are right. Synchronous code that I was comparing it to had os.close(ctx), but I forgot to add it in the async example, so I thought it was a bug. Closing this issue. -- resolution: -> not a bug stage: -> resolved status: open ->

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-11-24 Thread Thomas Kluyver
Thomas Kluyver added the comment: In the example script, I believe you need to close the write end of the pipe in the parent after forking: cpid = os.fork() if cpid == 0: # Write to pipe (child) else: # Parent os.close(ctx) # Read from pipe This is the same with synchronous

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-05-07 Thread Marko
Marko added the comment: @jaswdr Hm, this is was somewhat unexpected for me, since when reading directly from pipe, and EOF is sent. Timeout was somewhat awkward in my case, since I don't know when other process will start sending, and how long it would take. On the other hand, I use

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-05-03 Thread Jonathan Schweder
Jonathan Schweder added the comment: @kormang this is an expected behaviour, this is a problem even for the OS level, just because it is impossible to know when the reader needs to stop waiting, the best option here is to implement some timeout mechanism. -- nosy: +jaswdr

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-04-16 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +asvetlov, yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43806] asyncio.StreamReader hangs when reading from pipe and other process exits unexpectedly

2021-04-11 Thread Marko
New submission from Marko : When using asyncio to read from pipe, if process on the other side of pipe crashes read operation hangs indefinitely. Example: import asyncio import contextlib import os import signal import time prx, ctx = os.pipe() read_transport = None read_stream = None