Skip to content

v0.13.0

Latest

Choose a tag to compare

@MahmoudHassanMustafa MahmoudHassanMustafa released this 20 Jul 09:58
2eef8c4

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 with ECONNREFUSED forever). 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 new autoReconnect connection option (default true) lets operators opt out of automatic rebuilds. The reconnect tool remains available for a deliberate manual reset.