Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recognize fatal mysql2 connection errors
Connections created by MySQL2 driver transition to broken state when network errors or timeouts occur. This condition is not visible to the connection pool in Knex. If Knex detects a timeout and tries to close a connection, this causes an uncaught exception from MySQL2. Similarly the connection pool never realizes the connection is in a broken state, and thus will never replace it. Unfortunately the MySQL2 connection does not expose a state, but it can be inferred by checking for `connection._fatalError`. Fixes knex#1853
- Loading branch information