Skip to content

fix: pg0 info no longer reports live Windows instances as stopped - #49

Merged
nicoloboschi merged 2 commits into
mainfrom
fix/info-health-check
Nov 4, 2026
Merged

nicoloboschi merged 2 commits into
mainfrom
fix/info-health-check

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Fixes #41.

pg0 info and pg0 list run a SELECT 1 through psql before reporting running: 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 as stopped with no uri.

  • Raise PGCONNECT_TIMEOUT from 1 to 10 and statement_timeout from 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.
  • When the check fails, print psql's error to stderr. stdout, and so the JSON output, is unchanged.

cargo test --release -- --test-threads=1: 12/12 pass on macOS. Not tested on Windows yet; the reporter offered to re-test a build.

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.
@nicoloboschi
nicoloboschi merged commit 7b20420 into main Nov 4, 2026
15 checks passed
@nicoloboschi
nicoloboschi deleted the fix/info-health-check branch November 4, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] pg0 info reports "stopped" (uri=None) for a live, listening instance

1 participant