You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I trigger a manual failover from the RDS console (controlled failover), everything works as expected. The connection is logged as lost with the message "Connection lost: The server closed the connection." and a new connection is established on the next .query().
However, when a brutal failover occurs (e.g., the DBMS crashes), mysql2 does not detect that the connection has been lost, (indeed it's not closed by the DBMS since it crashed). The connection remains hanging indefinitely, and no reconnection attempt is made.
Is there a recommended way to handle this scenario with the current library? If not, do you have suggestion on how implement a more robust connection failure detection and recovery mechanism?
Expected Behavior:
When a brutal failover occurs, the library should detect the lost connection and discard it, so that a new connection can be established automatically.
Observed Behavior:
The connection hangs indefinitely without detecting the disconnection.
Steps to Reproduce:
Set up a connection pool as described above.
Trigger a brutal failover by crashing the DBMS.
Attempt to execute a query.
Hello,
I'm using mysql2 with a promise pool setup as follows:
When I trigger a manual failover from the RDS console (controlled failover), everything works as expected. The connection is logged as lost with the message "Connection lost: The server closed the connection." and a new connection is established on the next .query().
However, when a brutal failover occurs (e.g., the DBMS crashes), mysql2 does not detect that the connection has been lost, (indeed it's not closed by the DBMS since it crashed). The connection remains hanging indefinitely, and no reconnection attempt is made.
Is there a recommended way to handle this scenario with the current library? If not, do you have suggestion on how implement a more robust connection failure detection and recovery mechanism?
Expected Behavior:
When a brutal failover occurs, the library should detect the lost connection and discard it, so that a new connection can be established automatically.
Observed Behavior:
The connection hangs indefinitely without detecting the disconnection.
Steps to Reproduce:
Set up a connection pool as described above.
Trigger a brutal failover by crashing the DBMS.
Attempt to execute a query.
Environment:
mysql2 version: 3.9.9
Node.js version: 18
Database: Amazon RDS MySQL
Thank you :)
The text was updated successfully, but these errors were encountered: