Skip to content

fix(rds): close MySQL proxy sockets when either relay ends - #14

Open
wblazer wants to merge 1 commit into
alchemy-run:mainfrom
wblazer:fix/alchemy-mysql-relay-shutdown
Open

wblazer wants to merge 1 commit into
alchemy-run:mainfrom
wblazer:fix/alchemy-mysql-relay-shutdown

Conversation

@wblazer

@wblazer wblazer commented Sep 24, 2026

Copy link
Copy Markdown

Summary

Node processes using mysql2 can stay alive after connection.end() or pool.end() resolves against Floci's RDS proxy. The database closes its connection after COM_QUIT, but the proxy leaves the client socket open while waiting for the opposite relay thread to finish.

Close both sockets when either MySQL relay ends, following this fork's existing PostgreSQL bridge cleanup pattern. This wakes the other relay and lets clients finish shutting down. Authentication and data forwarding are unchanged.

The Node compatibility suite provisions a real MariaDB instance through the AWS SDK, exercises transactions and pooled-connection reuse, and checks that standalone and pooled mysql2 child processes exit naturally after .end(). There are no database mocks. A child that remains alive is killed at the timeout and fails the test.

Upstream counterpart: floci-io#4357 (also a draft). This PR targets Alchemy's current fork without importing unrelated upstream changes.

Type of change

  • Bug fix (fix:)

AWS Compatibility

The RDS control-plane API is unchanged. The fix propagates MySQL connection termination through the data-plane proxy rather than retaining an open client socket after backend EOF.

Checklist

  • ./mvnw test passes locally (full suite not run)
  • New or updated integration test added
  • Commit messages follow Conventional Commits

Deployment

  • No additional deployment steps.

@github-actions

Copy link
Copy Markdown

🎉 Thanks for your first pull request to Floci!

Your CI checks need a maintainer to approve them before they run. That is GitHub's standard gate on first-time contributors, not a problem with your PR — so if the checks look like they are doing nothing, that is why. Once a maintainer approves, CI and the compatibility suite start automatically. Nothing is needed from you in the meantime.

While you wait, a couple of things that make review faster:

  • Link the issue this fixes with Closes #N in the description
  • Commits follow Conventional Commits (feat(s3): ..., fix(dynamodb): ...)
  • Behaviour changes come with a test — see CONTRIBUTING.md

Come join us in Slack — it is the fastest way to reach maintainers if you get stuck, or want feedback on an approach before investing more time in it.

@wblazer
wblazer marked this pull request as ready for review September 24, 2026 22:28
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.

1 participant