Minor Changes
-
3cc26f8: Transparent connection recovery. Read tools (everything going through
queryWithTimeout) and query-acquisition (execute_query,explain_query,streaming_query) now auto-recover from a dropped connection or a dead SSH tunnel via a two-tier strategy: a quick single retry first — enough when mysql2 just needs to swap a stale pooled connection — then a full pool + SSH tunnel rebuild if the tunnel itself died (which mysql2 can't detect on its own and would otherwise hit withECONNREFUSEDforever). Recovery only wraps operations that are safe to re-run — reads, and pool acquisition before a statement is sent — so a write lost mid-statement is never silently retried.Guardrails: concurrent failures on the same connection coalesce into a single rebuild (single-flight); a failed rebuild opens a short per-connection cooldown so an outage fails fast (
RECONNECT_COOLDOWN) instead of making every subsequent call retry a doomed multi-second reconnect; and a newautoReconnectconnection option (defaulttrue) lets operators opt out of automatic rebuilds. Thereconnecttool remains available for a deliberate manual reset.