Skip to content

fix(connection): reject pending callbacks on transport death - #3170

Open
Simon Knott (Skn0tt) wants to merge 1 commit into
microsoft:mainfrom
Skn0tt:skn0tt-connection-error-callback-cancel
Open

fix(connection): reject pending callbacks on transport death#3170
Simon Knott (Skn0tt) wants to merge 1 commit into
microsoft:mainfrom
Skn0tt:skn0tt-connection-error-callback-cancel

Conversation

@Skn0tt

Copy link
Copy Markdown
Member

Every send used to race the protocol callback against transport.on_error_future, because a dead pipe only completed that future and never tore down in-flight calls.

This matches the Node client more closely: Connection.run() calls cleanup() when the transport ends, which rejects every pending callback. Sends just await their own future.

For remote connect, browser._on_close is still call_soon'd before cleanup(), so waiters still see reject-before-disconnect ordering.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3351313b-bb35-475c-ae04-f79e1d2e4086
# relies on it to attribute rejections to the right test.
if browser:
connection._loop.call_soon(browser._on_close)
connection.cleanup(reason)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like it'd reintroduce the problem solved by #3135

},
return_when=asyncio.FIRST_COMPLETED,
)
result = await callback.future

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like it'd reintroduce the problem solved by #3144

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