feat: implement consecutive failures healthcheck#32
Open
nest-aka-swan wants to merge 1 commit intomainfrom
Open
feat: implement consecutive failures healthcheck#32nest-aka-swan wants to merge 1 commit intomainfrom
nest-aka-swan wants to merge 1 commit intomainfrom
Conversation
Collaborator
|
@nest-aka-swan However, I think before adding complexity to the logic, it's worth trying to tune What real-world problem are you experiencing? Often flapping is caused by misconfigured connection limits rather than healthcheck sensitivity. For example, if you have 3 database hosts (1 primary + 2 replicas), 20 Node.js pods, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
healthcheckConsecutiveFailuresoption that requires a connection to fail health checks N times in a row before being marked unhealthy, preventing flaps from removing healthy replicas from the poolIntroduces a
setConnectionHealthhelper onPGDispatcherthat centralizes health state transitions and tracksconsecutiveFailuresper connection. Whenhealthy = true, the counter resets; whenhealthy = false, the counter increments and only marks the connection unhealthy once the threshold is reachedThe option is optional and backward-compatible: when unset (or 0), the behavior is the same as before