Repository navigation
Translate backend EOF errors into ProxyError - #53
Conversation
Catch the actual incomplete-read types produced by AnyIO v1 and asyncio v2. Preserve AnyIO's shielded EOF cleanup while using its specific handler. Add truncation, protocol-error, success and cancellation regressions. The identical 26 cases fail 14 times on upstream and pass with this fix. Owned-loopback project validation passes 429 tests on macOS Python 3.14; full Mypy retains three unchanged upstream test-helper diagnostics.
|
In asyncio v2 we should handle |
Translate the asyncio error in read_exactly and keep the original exception as its cause. Catch the package error in the proxy after the existing cleanup. Keep the cancellation type and cleanup assertions on every supported Python version and check the message where asyncio propagates it.
|
Addressed in Python 3.14.7 passed 429 tests, Ruff, and Mypy. All 26 focused tests passed on Python 3.9.25. I maintain Ponder and used it to review this follow-up. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #53 +/- ##
==========================================
+ Coverage 94.38% 95.22% +0.84%
==========================================
Files 55 55
Lines 1566 1570 +4
==========================================
+ Hits 1478 1495 +17
+ Misses 88 75 -13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AnyIO v1 catches the stdlib incomplete-read exception, but its stream raises the package exception. Asyncio v2 has the reverse mismatch. A peer closing during negotiation therefore bypasses the intended
ProxyErrorconversion.Catch each stream's actual EOF type. Keep AnyIO's existing shielded cleanup behavior when moving EOF into its specific handler. The regression uses the public proxy APIs with both AnyIO backends and asyncio v2. It covers truncated replies, protocol errors, successful tunnels and cancellation.
Local validation against upstream
8d054e5855e354735b95f2004d9fe8242920e261:Other Python versions, operating systems and hosted CI were not run locally. The close-cancellation regression uses an owned asynchronous test stream; it does not demonstrate a native transport leak.
I maintain Ponder. Its review flagged the mismatched EOF handlers and helped check cleanup preservation. I implemented the patch and ran the checks above.