Skip to content

Add configurable database connection pool size#4097

Merged
jmg-duarte merged 2 commits intomainfrom
jmgd/db-pool-size
Jan 28, 2026
Merged

Add configurable database connection pool size#4097
jmg-duarte merged 2 commits intomainfrom
jmgd/db-pool-size

Conversation

@jmg-duarte
Copy link
Copy Markdown
Contributor

@jmg-duarte jmg-duarte commented Jan 28, 2026

Description

We had an incident where latency increase due to queries waiting for available connections. This PR provides a configuration for that.

Adds --db-max-connections (env: DB_MAX_CONNECTIONS) flag to configure the maximum database pool size. Default is 10.

Changes

  • New config for DB connection pool size
  • Add it to autopilot, orderbook, refunder

How to test

E2E + staging (?)

Adds `--db-max-connections` flag (env: `DB_MAX_CONNECTIONS`) to
configure the maximum database pool size. Default is 10.

Services affected: autopilot, orderbook, refunder

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jmg-duarte jmg-duarte requested a review from a team as a code owner January 28, 2026 12:10
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a configurable database connection pool size. The review confirms one high-severity issue: the application is susceptible to a panic if a user provides 0 for the maximum number of connections. A fix is suggested to validate this at the argument parsing stage.

Comment thread crates/shared/src/arguments.rs Outdated
Comment thread crates/shared/src/arguments.rs
Copy link
Copy Markdown
Contributor

@squadgazzz squadgazzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmg-duarte jmg-duarte enabled auto-merge January 28, 2026 15:09
@jmg-duarte jmg-duarte added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit ff38a3e Jan 28, 2026
19 checks passed
@jmg-duarte jmg-duarte deleted the jmgd/db-pool-size branch January 28, 2026 15:31
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants