• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 47142452976
81%

Build:
DEFAULT BRANCH: main
Ran 03 Dec 2026 03:49PM UTC
Jobs 2
Files 355
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Dec 2026 03:45PM UTC coverage: 81.081% (+0.03%) from 81.055%
47142452976

push

github

web-flow
fix(readyz): probe Postgres on a connection the readiness check owns (#1356) (#1362)

## Summary

Closes #1356. `/readyz` reported `database: {ok:false}` against a
healthy database for hours, twice on 2026-12-03, until the relay was
restarted.

## Cause

`pingDatabase()` ran `SELECT 1` through the master pool. That pool's
`max` is 3, and three queries that never completed held every slot. The
ping races the query against `ADMIN_DEPENDENCY_PING_TIMEOUT_MS` (3 s),
but that race neither cancels the query nor releases the connection, and
`knex`'s `acquireConnectionTimeout` is 60 s — so the ping gave up while
its acquire stayed queued, and the next ping queued behind it. Readiness
then answered "database down" for as long as the stuck sessions lived.

## Change

- `pingDatabase()` now opens a client of its own from the master
connection config (`getMasterConnectionConfig()`, new export beside the
pool config) and closes it when the probe answers. A saturated
application pool can no longer make readiness lie.
- Connect, query and statement are all bounded by the same
`ADMIN_DEPENDENCY_PING_TIMEOUT_MS` (`connectionTimeoutMillis`,
`query_timeout`, `statement_timeout`), so a hung probe is cancelled
server-side rather than left running.
- On timeout the probe destroys its socket before ending the client: the
query cannot outlive the answer, and the connection is not left open for
the server to reap.
- `/readyz` itself is unchanged — same endpoint, same JSON, same
200/503. `deploy/README.md` now states the probe's own-connection rule
and why the pool's `max` makes it necessary.

## Verification

- Unit tests (`test/unit/utils/admin-health.spec.ts`): success, connect
failure, a hung query destroyed at the timeout (and the probe returning
in ~51 ms), and `end()` throwing. 8 passing.
- Against the relay's real Postgres with all three pool slots held by
`pg_sleep(45)`:

```
{"legacy":"timeout","legacyMs":3001,"databaseOk":true,"snapshotMs":8}
```

The pooled `raw('s... (continued)

6539 of 8696 branches covered (75.2%)

Branch coverage included in aggregate %.

36 of 36 new or added lines in 1 file covered. (100.0%)

13252 of 15713 relevant lines covered (84.34%)

707.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Integration - 47142452976.1 03 Dec 2026 03:49PM UTC 355
36.69
GitHub Action Run
2 Unit - 47142452976.2 03 Dec 2026 03:50PM UTC 355
79.23
GitHub Action Run
Source Files on build 47142452976
  • Tree
  • List 355
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #47142452976
  • 0da5ca84 on github
  • Prev Build on main (#47113400328)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc