Skip to content

Fix flaky proxy teardown - #14

Merged
Pliner merged 1 commit into
Pliner:mainfrom
slawwan:fix-flaky-proxy-teardown
Oct 6, 2026
Merged

Pliner merged 1 commit into
Pliner:mainfrom
slawwan:fix-flaky-proxy-teardown

Conversation

@slawwan

@slawwan slawwan commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Tests intermittently fail at tcp_proxy teardown with CancelledError in drop_connections(), e.g. 37441620754, 37437410472, 37437424396, 37480791078.

TcpProxy._pipe awaits writer.wait_closed() in finally. When TaskGroup cancels the pipe at that moment, the cancellation propagates to the stream's shared close waiter future, so a later wait_closed() on the same writer in drop_connections() raises CancelledError. The fix shields the wait.

test_cancelled_pipe_does_not_break_connection_closure reproduces it deterministically: fails on main, passes with the fix.

@slawwan
slawwan marked this pull request as ready for review October 6, 2026 17:08
@slawwan
slawwan requested a review from Pliner October 6, 2026 17:08
@Pliner
Pliner merged commit fda75bb into Pliner:main Oct 6, 2026
5 checks passed
@slawwan
slawwan deleted the fix-flaky-proxy-teardown branch October 6, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants