Skip to content

fix: add missing DB pool settings to Settings — CRITICAL deploy blocker (#197) - #197

Merged
welshDog merged 2 commits into
mainfrom
fix/missing-db-pool-settings
Jul 15, 2026
Merged

fix: add missing DB pool settings to Settings — CRITICAL deploy blocker (#197)#197
welshDog merged 2 commits into
mainfrom
fix/missing-db-pool-settings

Conversation

@welshDog

@welshDog welshDog commented May 1, 2026

Copy link
Copy Markdown
Owner

🚨 THIS WAS THE REAL DEPLOY BLOCKER

The Error

AttributeError: 'Settings' object has no attribute 'DB_POOL_SIZE'
  File "/app/app/db/session.py", line 15, in <module>
    pool_size=settings.DB_POOL_SIZE,

The app was crashing before Uvicorn even started — which explains why Railway's healthcheck saw zero HTTP requests reaching the container. Not a routing issue. Not a port issue. A hard Python crash at import time.

Root Cause

session.py references 4 Settings attributes that didn't exist:

  • settings.DB_POOL_SIZE
  • settings.DB_POOL_MAX_OVERFLOW
  • settings.DB_POOL_TIMEOUT
  • settings.DB_POOL_RECYCLE_TIMEOUT

Fix

Added all 4 to Settings class in config.py with Railway-safe defaults:

# Database connection pool — Railway-safe defaults
DB_POOL_SIZE: int = 5
DB_POOL_MAX_OVERFLOW: int = 10
DB_POOL_TIMEOUT: int = 30
DB_POOL_RECYCLE_TIMEOUT: int = 3600

Expected result after merge

  • App boots cleanly ✅
  • Uvicorn starts on 0.0.0.0:8000 ✅
  • Railway healthcheck GET /health returns 200 ✅
  • Deploy goes green ✅

Summary by CodeRabbit

  • Performance
    • Reduced the default database connection pool size to improve resource efficiency in standard deployments.

session.py references DB_POOL_SIZE, DB_POOL_MAX_OVERFLOW,
DB_POOL_TIMEOUT and DB_POOL_RECYCLE_TIMEOUT but none of these
existed in the Settings class, causing AttributeError on startup
and 18+ consecutive Railway deploy failures.

Adds sensible Railway-safe defaults (pool_size=5, max_overflow=10).
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4cd81e43-aabd-4d36-8dd6-b7d50506aa7b

📥 Commits

Reviewing files that changed from the base of the PR and between e303a99 and 2fbbcbe.

📒 Files selected for processing (1)
  • backend/app/core/config.py

📝 Walkthrough

Walkthrough

The Settings database connection pool default is reduced from 25 to 5. Several inline comments are removed, while the related field values and extra="ignore" configuration remain unchanged.

Changes

Configuration settings

Layer / File(s) Summary
Settings default and documentation cleanup
backend/app/core/config.py
Reduces DB_POOL_SIZE from 25 to 5 and removes selected inline comments without changing the associated settings or model configuration.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

I’m a rabbit with settings to tune,
Five pool slots beneath the moon.
Comments hop away, values stay,
extra="ignore" guards the way,
And config grows lighter by day.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change by describing the added DB pool settings in Settings and the deployment impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/missing-db-pool-settings

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.25.0)
backend/app/core/config.py

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@welshDog
welshDog merged commit 9fd622f into main Jul 15, 2026
2 of 20 checks passed
@welshDog
welshDog deleted the fix/missing-db-pool-settings branch July 15, 2026 19:32
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