Skip to content

fix(server): close connection on client Terminate#438

Merged
sunng87 merged 1 commit into
sunng87:masterfrom
killme2008:fix/close
Jun 6, 2026
Merged

fix(server): close connection on client Terminate#438
sunng87 merged 1 commit into
sunng87:masterfrom
killme2008:fix/close

Conversation

@killme2008
Copy link
Copy Markdown
Contributor

Intro

The frontend message loop matched Terminate ('X') with a catch-all _ => {}, so the backend never dropped the socket.

A client that closes gracefully by sending Terminate and then waiting for the server to close the connection (e.g. asyncpg's Connection.close()) would block forever.

Break out of the read loop on Terminate so the framed socket is dropped and the TCP connection closes, as the protocol requires.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
@sunng87 sunng87 merged commit 682a562 into sunng87:master Jun 6, 2026
10 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