Skip to content

fix: default DB_POOL_TIMEOUT to 5 s - #106

Merged
lesnik512 merged 2 commits into
mainfrom
pool-timeout-5s
Oct 22, 2026
Merged

lesnik512 merged 2 commits into
mainfrom
pool-timeout-5s

Conversation

@lesnik512

@lesnik512 lesnik512 commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #105, which left Granian's backpressure at its default. Requests beyond the pool's capacity now wait on the pool, so DB_POOL_TIMEOUT sets how long an overloaded worker holds a request before answering 503.

At 30 s a client under sustained overload waited half a minute for that 503, and most clients and proxies give up sooner, so the 503 often never reached anyone. 5 s still covers a short burst or one slow query and sheds sustained overload quickly. Deployments that need longer can set DB_POOL_TIMEOUT.

Changes

  • Settings.db_pool_timeout defaults to 5 instead of 30.
  • AGENTS.md states the new default.

Testing

just test: 87 passed, 100% coverage. ruff format --check and ruff check are clean.

@lesnik512
lesnik512 merged commit e2bc3b1 into main Oct 22, 2026
3 checks passed
@lesnik512
lesnik512 deleted the pool-timeout-5s branch October 22, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant