{{ message }}
Repository navigation
Conversation
…pools When the postmaster is stuck, a new local connection is accepted but never answered, so the caller hangs forever. The status endpoint is one such caller, and on shutdown the web server waits for it until the manager gives up after 30 seconds, delaying the release of the primary lease. Use connect_timeout=5, as we already do for the primary. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Contributor
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
Member
Author
|
/test |
Contributor
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.

The superuser and metrics exporter pools connect to PostgreSQL with no timeout, and every query opens a new connection. When the postmaster is stopped or stuck, its socket still accepts connections but never answers the startup message, so every caller blocks for good. The instance status endpoint polled by the operator is one of them. On a KIND cluster with the primary's postmaster stopped with SIGSTOP, a goroutine dump shows the
pgStatushandlers blocked inpgconn.connectOne. At shutdown the:8000web server waits for them until the controller manager gives up 30 seconds later, which delays the release of the primary lease by as much.This sets
connect_timeout=5on both pools, as the connections to the primary already do. With #11358 applied, the same scenario releases the lease 5 seconds after the instance manager decides to exit, instead of 30.