Repository navigation
Conversation
|
@gpshead This is the simplest approach, no need to track delay per transport and for a local pipe I think the extra retries during a long stall are a reasonable trade-off. With a fast reader, a fixed 1ms gives the same throughput as #162058 (0.5 MiB/s on my box.) We have a similar pattern already: cpython/Lib/asyncio/selector_events.py Lines 203 to 208 in e0d0f2e More than happy to switch to the adaptive backoff approach. Thank you! |
Are the retries causing any real world issue? This is technically a macOS bug and I don't think this needs to be worked around in asyncio given that is not a correctness issue. |
On macOS, a full pipe can keep reporting that it is writable even though
os.write()raisesBlockingIOError. When this happens, asyncio retries the buffered write on every event loop iteration.If the write-ready callback gets
BlockingIOError, pause write notifications for 1 ms, then resume them if there is still data.ref #162016 (comment)
Reproduction fix