Description
I have a PoolCluster of three nodes, all selected into one wildcard Round Robin pool.
canRetry is enabled and removeNodeErrorCount is set to 1
Every 30 seconds, I get a connection from the pool, check for any error and in case everything is fine, I run a 'SELECT 1' on the pool.
This works fine when all 3 nodes are reachable. However, when I take one of them offline (i.e., blackhole the route to that node) and the round robin reaches that node, I often get:
Error: Cannot enqueue Quit after fatal error.
at Protocol._validateEnqueue (node_modules/mysql/lib/protocol/Protocol.js:192:16)
at Protocol._enqueue (node_modules/mysql/lib/protocol/Protocol.js:129:13)
at Protocol.quit (node_modules/mysql/lib/protocol/Protocol.js:87:36)
at PoolConnection.end [as _realEnd] (node_modules/mysql/lib/Connection.js:214:18)
at Pool.end (node_modules/mysql/lib/Pool.js:158:16)
at PoolCluster._increaseErrorCount (node_modules/mysql/lib/PoolCluster.js:135:17)
at node_modules/mysql/lib/PoolCluster.js:153:12
at Pool.<anonymous> (node_modules/mysql/lib/Pool.js:47:16)
at Handshake.Sequence.end (node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
at node_modules/mysql/lib/protocol/Protocol.js:367:16
My debugging shows that when this happens, it happens during the getConnection call. Code preceding that is executed but the callback is never called, the function body simply isn't reached before I get the above stacktrace.
Sometimes everything goes fine and the remove event is triggered without issue. Interesting case of a heisenbug.
Note: I am running node-mysql version 2.4.1 and node version 0.10.26