Skip to content

Commit 43d461e

Browse files
committed
fix(pool): only transition to DISCONNECTED if reconnect enabled
1 parent fd4f4ce commit 43d461e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/core/connection/pool.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ function connectionFailureHandler(pool, event, err, conn) {
273273
// No more socket available propegate the event
274274
if (pool.socketCount() === 0) {
275275
if (pool.state !== DESTROYED && pool.state !== DESTROYING && pool.state !== DRAINING) {
276-
stateTransition(pool, DISCONNECTED);
276+
if (pool.options.reconnect) {
277+
stateTransition(pool, DISCONNECTED);
278+
}
277279
}
278280

279281
// Do not emit error events, they are always close events

0 commit comments

Comments
 (0)