From 0492f210de2e4baa7e52bc36f345f13bd17f4aee Mon Sep 17 00:00:00 2001 From: "Aaron K. Clark" Date: Tue, 19 May 2026 08:16:48 -0500 Subject: [PATCH] =?UTF-8?q?docs(healthz):=20correct=20stale=20"2s=20timeou?= =?UTF-8?q?t"=20comment=20=E2=80=94=20no=20timeout=20is=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inline comment on the SELECT 1 probe in /healthz claimed "Sequelize uses pg's query_timeout for this on Postgres. 2s is well over the expected sub-ms response..." but no `timeout` / `query_timeout` option is actually passed to `sequelize.query()` — and the Sequelize options bag at the call site doesn't expose a per-query timeout for postgres anyway. The comment has been wrong since the original /healthz PR (#4) and likely misled operators looking for a tunable. Replace the comment with an accurate description of the current behavior (the request hangs until the orchestrator's own probe timeout fires) and a pointer to how to add a real one if it ever matters (`dialectOptions.statement_timeout` in db.config.js). Comment-only change; no behavior change. 688 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/controllers/healthcontroller.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/healthcontroller.js b/app/controllers/healthcontroller.js index 101189a..1737267 100644 --- a/app/controllers/healthcontroller.js +++ b/app/controllers/healthcontroller.js @@ -62,12 +62,14 @@ exports.healthz = async (req, res) => { try { // Cheapest possible DB-roundtrip: `SELECT 1`. Confirms the // pool can hand us a connection AND that Postgres responds. + // NOTE: there's no per-query timeout here — Sequelize doesn't + // expose one for postgres at this layer. A hung backend will + // hang the probe until the orchestrator's own probe timeout + // (typically 5–10s) fires. If that turns out to be a problem + // in practice, set pg's statement_timeout via dialectOptions + // in db.config.js so it applies pool-wide. await db.sequelize.query('SELECT 1 AS ok;', { type: db.sequelize.QueryTypes.SELECT, - // Short timeout so a hung DB doesn't drag the probe out. - // Sequelize uses pg's `query_timeout` for this on Postgres. - // 2s is well over the expected sub-ms response, well under - // a typical orchestrator probe timeout (usually 5–10s). raw: true, }); dbOk = true;