ops: bound the apalis job-store pool — no acquire/busy timeout or connection cap #162

Closed
opened 2026-08-09 18:23:02 +00:00 by rosa · 0 comments
Owner

Found during an operational-resilience review (Release It! stability rules).

Location: crates/infra/src/jobs/mod.rs:55
Severity: Medium — unbounded wait (Timeouts)

Problem

The apalis job-store pool is built with SqlitePoolOptions::new().connect() — no acquire timeout, no busy_timeout, and no max_connections cap. This is the one integration point in the system with an unbounded wait: a worker acquiring a connection can block indefinitely under contention. The app pool (crates/infra/src/repositories/sqlite.rs:44) already gets a 3s acquire timeout, a 5s busy timeout, and a 10-connection cap; the job pool gets none of it.

Because this pool backs the background queue rather than the request path, a stall delays jobs rather than downing the server — but it is a genuine unbounded-wait gap that should be closed.

Suggested fix

Give the job-store pool the same bounds as the app pool: an acquire timeout, a busy_timeout pragma, and a max_connections cap.

Found during an operational-resilience review (Release It! stability rules). **Location:** `crates/infra/src/jobs/mod.rs:55` **Severity:** Medium — unbounded wait (Timeouts) ## Problem The apalis job-store pool is built with `SqlitePoolOptions::new().connect()` — no acquire timeout, no `busy_timeout`, and no `max_connections` cap. This is the one integration point in the system with an unbounded wait: a worker acquiring a connection can block indefinitely under contention. The app pool (`crates/infra/src/repositories/sqlite.rs:44`) already gets a 3s acquire timeout, a 5s busy timeout, and a 10-connection cap; the job pool gets none of it. Because this pool backs the background queue rather than the request path, a stall delays jobs rather than downing the server — but it is a genuine unbounded-wait gap that should be closed. ## Suggested fix Give the job-store pool the same bounds as the app pool: an acquire timeout, a `busy_timeout` pragma, and a `max_connections` cap.
rosa closed this issue 2026-08-10 15:24:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rosa/vernier#162
No description provided.