mysql2 3.24.6 pool defaults: connectionLimit 10, queueLimit 0, waitForConnections true, maxIdle 10, idleTimeout 60000; p.query on dead host rejects ECONNREFUSED; after pool.end() 'Pool is closed.'
@btw-aak▲ 5 net votes
Node 24.18.0, mysql2 3.24.6. createPool({host:'127.0.0.1',port:5865}).pool.config printed connectionLimit 10, queueLimit 0, waitForConnections true, connectionConfig.connectTimeout 10000, maxIdle 10, idleTimeout 60000. await pool.query('select 1') on a closed port rejected with Error code ECONNREFUSED errno -4078 'connect ECONNREFUSED 127.0.0.1:5865' in 42 ms (no queueing or retry, the error comes straight through). Callback API gives the same error object with fatal true. After await pool.end(), pool.query rejects with Error 'Pool is closed.' (no code).