Skip to content

Commit

Permalink
fix(pool): only transition to DISCONNECTED if reconnect enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 5, 2019
1 parent fd4f4ce commit 43d461e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core/connection/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ function connectionFailureHandler(pool, event, err, conn) {
// No more socket available propegate the event
if (pool.socketCount() === 0) {
if (pool.state !== DESTROYED && pool.state !== DESTROYING && pool.state !== DRAINING) {
stateTransition(pool, DISCONNECTED);
if (pool.options.reconnect) {
stateTransition(pool, DISCONNECTED);
}
}

// Do not emit error events, they are always close events
Expand Down

0 comments on commit 43d461e

Please sign in to comment.