Skip to content

feat(webapp): per-client database pool and connect timeout overrides - #4515

Merged
ericallam merged 1 commit into
mainfrom
feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars
Aug 5, 2026
Merged

feat(webapp): per-client database pool and connect timeout overrides#4515
ericallam merged 1 commit into
mainfrom
feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars

Conversation

@ericallam

@ericallam ericallam commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

Follow-on to #4513. The database connect timeout is now honored, but a single global value has to serve three separate databases at once (control-plane, legacy run-ops, and run-ops). This adds optional per-client overrides for the Prisma pool and connect timeouts, one pair for the writer and one for the read replica of each of the three databases, each falling back to the shared DATABASE_POOL_TIMEOUT / DATABASE_CONNECTION_TIMEOUT when unset.

That lets one database's clients run a fail-fast connect timeout (with a bounded pool wait) while another keeps more headroom, without a single knob forcing the same tradeoff everywhere. No behavior change until an override is set.

It also tags each client's queries with its specific datasource (control-plane / legacy-run-ops / run-ops, writer or replica) via the db.datasource span attribute, so telemetry can attribute connection behavior to a specific database instead of just writer-vs-replica.

@changeset-bot

changeset-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: de14062

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ericallam
ericallam marked this pull request as ready for review August 5, 2026 15:21
devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b64cbc85-fd7a-4344-869f-092009744ebe

📥 Commits

Reviewing files that changed from the base of the PR and between 1a16d61 and de14062.

📒 Files selected for processing (4)
  • .server-changes/per-client-connection-timeouts.md
  • apps/webapp/app/db.server.ts
  • apps/webapp/app/env.server.ts
  • docs/self-hosting/env/webapp.mdx
🚧 Files skipped from review as they are similar to previous changes (4)
  • .server-changes/per-client-connection-timeouts.md
  • apps/webapp/app/env.server.ts
  • docs/self-hosting/env/webapp.mdx
  • apps/webapp/app/db.server.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (13)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 12)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp

Walkthrough

Database configuration now supports separate pool and connection timeout settings for primary and run-ops writers and read replicas. Environment values are parsed as optional integers. Each client uses its specific settings when provided and shared timeout values otherwise. Datasource labels now distinguish control-plane, run-ops, and legacy run-ops clients. A change note documents the new configuration behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers the feature purpose and implementation details. However, it omits the required checklist section, testing section, and changelog section from the template. Add the required template sections: Testing steps, Changelog entry, and the Checklist (even if marked incomplete) to comply with repository standards.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding per-client database pool and connect timeout overrides for the webapp.
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 feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars

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.

coderabbitai[bot]

This comment was marked as resolved.

@ericallam
ericallam force-pushed the feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars branch from 3512762 to 9dbcc5f Compare August 5, 2026 15:37
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

devin-ai-integration[bot]

This comment was marked as resolved.

@ericallam
ericallam force-pushed the feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars branch from 9dbcc5f to f188fe9 Compare August 5, 2026 15:41
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

devin-ai-integration[bot]

This comment was marked as resolved.

@ericallam
ericallam force-pushed the feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars branch from f188fe9 to 9ef9ac2 Compare August 5, 2026 15:46
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Adds optional per-client env overrides for the Prisma pool_timeout and connect_timeout, one pair each for the writer and read replica of the control-plane, legacy run-ops, and run-ops databases, falling back to the shared DATABASE_POOL_TIMEOUT / DATABASE_CONNECTION_TIMEOUT when unset.

This lets each database be tuned independently, e.g. a fail-fast connect timeout on one without changing the others. It also tags each client's queries with its specific datasource (control-plane, legacy-run-ops, or run-ops; writer or replica) so telemetry can attribute connection behavior per database. No behavior change until an override is set.
@ericallam
ericallam force-pushed the feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars branch from 9ef9ac2 to de14062 Compare August 5, 2026 16:09
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@ericallam
ericallam merged commit 58bf4e2 into main Aug 5, 2026
43 checks passed
@ericallam
ericallam deleted the feature/tri-12997-feat-per-client-pool_timeout-and-connect_timeout-env-vars branch August 5, 2026 16:26
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.

2 participants