Skip to content

Stop retaining MySQL connections after clients exit - #39

Merged
morgo merged 2 commits into
block:release-24.0from
alec-manabat:amanabat/binlog-heartbeats
Nov 9, 2026
Merged

morgo merged 2 commits into
block:release-24.0from
alec-manabat:amanabat/binlog-heartbeats

Conversation

@alec-manabat

@alec-manabat alec-manabat commented Nov 5, 2026 •

Copy link
Copy Markdown

Description

The MySQL topology backend lets clients listen for database configuration changes. An idle sender waits for changes and can miss a client disconnect. MySQL then keeps the abandoned connection and its memory.

Request a tiny message every second (a heartbeat). If the client has exited, the next send fails and MySQL releases the connection.

The regression test opens a connection, closes the client, and checks that MySQL removes the connection.

Related Issue(s)

None.

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches. (N/A. This PR targets release-24.0 directly.)
  • If this change is to be back-ported to previous releases, a justification is included in the PR description. (N/A. No additional backport requested.)
  • Tests were added or are not required.
  • Did the new or modified tests pass consistently locally and on CI?
    • Local race tests passed on MySQL 8.0.44 and 8.4.13. The CI unit-test workflow has not run and reports action_required.
  • Documentation was added or is not required.

Deployment Notes

Rebuild and restart applications that use this backend. The fix prevents new abandoned connections. Connections already abandoned before rollout need one-time cleanup.

AI Disclosure

Code and test changes authored with Codex.

Signed-off-by: Alec Manabat <amanabat@squareup.com>
Signed-off-by: Alec Manabat <amanabat@squareup.com>
@alec-manabat alec-manabat changed the title Release idle binlog sessions with heartbeats Release idle MySQL topology binlog sessions Nov 5, 2026
@alec-manabat alec-manabat changed the title Release idle MySQL topology binlog sessions Release MySQL connections after topology clients exit Nov 5, 2026
@alec-manabat alec-manabat changed the title Release MySQL connections after topology clients exit Stop retaining MySQL connections after clients exit Nov 5, 2026
@morgo
morgo marked this pull request as ready for review November 6, 2026 15:50
@morgo
morgo merged commit 05bc111 into block:release-24.0 Nov 9, 2026
98 of 118 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