Repository navigation
fix: pg0 info no longer reports live Windows instances as stopped - #49
Merged
Merged
Conversation
The connect timeout was 1s (2s after libpq rounding), too short on some Windows machines, so live instances were reported as stopped. Raise it to 10s and statement_timeout to 5s, and print psql's stderr when the check fails. Fixes #41.
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.
Fixes #41.
pg0 infoandpg0 listrun aSELECT 1through psql before reportingrunning: true. Its connect timeout was 1s, which libpq rounds up to 2s. The reporter confirmed that on their Windows machine the connection consistently takes longer than that (a new backend process per connection, plus antivirus), so live instances showed asstoppedwith nouri.PGCONNECT_TIMEOUTfrom 1 to 10 andstatement_timeoutfrom 1000 to 5000 ms. The check stays bounded, so a broken backend (fix: verify database connectivity before reporting running #28) still reports as stopped, just after up to 10s instead of 2s.cargo test --release -- --test-threads=1: 12/12 pass on macOS. Not tested on Windows yet; the reporter offered to re-test a build.