Skip to content

[4.5] Fail every MySQL command when the connection closes - #1819

Merged
tsegismont merged 1 commit into
eclipse-vertx:4.xfrom
timothygk:fix-mysql-close-fails-inflight-commands
Dec 2, 2026
Merged

tsegismont merged 1 commit into
eclipse-vertx:4.xfrom
timothygk:fix-mysql-close-fails-inflight-commands

Conversation

@timothygk

Copy link
Copy Markdown

Fixes #1818

When a MySQL connection closes, MySQLCodec.fail sends a failure response only for the first command.
It sends no response for these commands:

  • A command that a failure handler writes after the failure, for example a transaction ROLLBACK.
    This occurs with the default pipelining limit of 1.
  • The other in-flight commands, when the pipelining limit is more than 1 or a cached statement close is in flight.

The futures of these commands never complete.

MySQLCodec.fail sent a failure response only for the first command after
a connection failure. The other pipelined commands, and commands written
by a failure handler such as a transaction ROLLBACK, never completed.

Send a failure response for each command. Let the connection handle the
close before the in-flight commands fail, so that a failure handler cannot
give the closed connection to a pool waiter. Do not complete pending
fire-and-forget commands as successful after a failure.

Signed-off-by: Timothy Kurniawan <timothykurniawan@gmail.com>

@tsegismont tsegismont left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @timothygk , looks good to me.

@tsegismont
tsegismont merged commit c43ce7d into eclipse-vertx:4.x Dec 2, 2026
18 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