sqlite-timeout
SQLite: query timeout
The sections below are generated from the CLI (methodology 0.3-draft, CLI 0.3.0); the same text is printed by sealmark explain sqlite-timeout.
- pack
sqlite- weight
- scored
- scope
- server (SQLite only in this release; DuckDB is planned)
- decided by
- response
- since
- 0.2-draft (methodology 0.3-draft)
- config keys
checks.sqlite-timeout.enabledchecks.sqlite-timeout.expected_secchecks.sqlite-timeout.severitytimeout_probe_sec
Probes
recursive-seriesWITH RECURSIVE c(x) AS (SELECT 1 UNION ALL SELECT x + 1 FROM c WHERE x < 1e10) SELECT count(*) FROM ccross-joinSELECT count(*) FROM big_table a CROSS JOIN big_table b WHERE a.id + b.id = -1 (used when the server refuses the recursive series)
Settings and thresholds
Every check also takes checks.sqlite-timeout.enabled and checks.sqlite-timeout.severity; they are described once in the configuration reference.
| Threshold | Default | Set with | Standard |
|---|---|---|---|
expected_sec | 10 | checks.sqlite-timeout.expected_sec | locked |
| Key | Default | Standard | Meaning |
|---|---|---|---|
checks.sqlite-timeout.expected_sec | none | locked | Seconds a runaway query may run before sqlite-timeout fails. null uses timeout_probe_sec. |
timeout_probe_sec | 10 | locked | Seconds the cap and timeout probes wait before a call counts as running too long (flag --timeout-probe). |
How the verdict is established
- Scoring. scored: pass = 1 point, part = 0.5, fail = 0. A fail lowers the pack's percentage but never caps the letter.
What to fix
Interrupt long queries after a deadline (sqlite3_interrupt or a progress handler) so a runaway recursive or cross-join query is cancelled. The harness waits expected_sec + 8 s (18 s with the default 10) for the cancel; a server that cancels later is reported as having no timeout, so set --timeout-probe or checks.sqlite-timeout.expected_sec to the server's value.
False positives
A server that refuses both runaway forms is reported as not measured (n/a), never as a pass or a fail.
False negatives
The harness waits expected_sec + 8 seconds, so a timeout longer than that is reported as no timeout; set --timeout-probe to the server's own value. SQLite has no sleep function, so the probe is a CPU-bound query. A server that cancels only certain query shapes could pass.