From ec382a2ea81afc6b3926bfbe4f5e93ec51f28949 Mon Sep 17 00:00:00 2001 From: Dat Vong Date: Mon, 27 May 2019 19:15:31 -0700 Subject: [PATCH] docs: document PoolCluster disconnect behavior closes #2224 --- Readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Readme.md b/Readme.md index 51bd6321e..d7c9aa20c 100644 --- a/Readme.md +++ b/Readme.md @@ -650,6 +650,13 @@ terminated, an existing connection object cannot be re-connected by design. With Pool, disconnected connections will be removed from the pool freeing up space for a new connection to be created on the next getConnection call. +With PoolCluster, disconnected connections will count as errors against the +related node, incrementing the error code for that node. Once there are more than +`removeNodeErrorCount` errors on a given node, it is removed from the cluster. +When this occurs, the PoolCluster may emit a `POOL_NONEONLINE` error if there are +no longer any matching nodes for the pattern. The `restoreNodeTimeout` config can +be set to restore offline nodes after a given timeout. + ## Performing queries The most basic way to perform a query is to call the `.query()` method on an object