Skip to main content

SQLITE_BUSY_MAX_DELAY_MS

Constant SQLITE_BUSY_MAX_DELAY_MS 

Source
pub const SQLITE_BUSY_MAX_DELAY_MS: u64 = 5_000;
Expand description

Ceiling on ONE busy-retry sleep, in milliseconds.

Doubling without a ceiling turns two configuration knobs into an unbounded wait, and both are operator-settable: db.busy_retries and db.busy_base_delay_ms. Measured on a workstation carrying 12 and 600, the twelfth attempt alone sleeps past twenty minutes and the full schedule costs roughly half an hour — for a single contended statement. That is not a tuning choice anyone made; it is what exponential growth does to a knob whose range nobody bounded.

Five seconds matches BUSY_TIMEOUT_MILLIS, so the longest a retry waits is the same order as the lock timeout SQLite itself applies. Attempts are still capped by db.busy_retries; only the growth of each sleep stops here.