Skip to content

Fix leaking io coroutines#3109

Merged
dpkp merged 2 commits into
dpkp:masterfrom
azdobylak:fix/leaking-io-coroutines
Jun 28, 2026
Merged

Fix leaking io coroutines#3109
dpkp merged 2 commits into
dpkp:masterfrom
azdobylak:fix/leaking-io-coroutines

Conversation

@azdobylak

Copy link
Copy Markdown
Contributor

I found one more leak in the transport layer cleanup. Previously, I/O tasks were only being reclaimed when the peer (broker) closed the connection and even then, only as a side effect of the read-error path. When the broker disconnected, the socket became readable, returned an EOF error, and forced the task to abort and exit.

However, on locally-initiated closes (like idle-connection reaping, request timeouts, or rebalances), transport._close() would close the socket and unregister it without ever cancelling the parked I/O waiters. Because there was no incoming I/O event to trigger an error and wake them up, the reader and writer coroutines stayed permanently stranded in net._pending_tasks in a WAIT_IO state.

@dpkp

dpkp commented Jun 28, 2026

Copy link
Copy Markdown
Owner

thanks!!

@dpkp dpkp merged commit 4b10b5b into dpkp:master Jun 28, 2026
19 checks passed
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