You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(webapp): per-client database pool and connect timeout overrides (#4515)
## 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.
Allow the database connection pool and connect timeouts to be tuned separately for each database's writer and read replica, falling back to the shared defaults when unset.
"must not be a known-insecure published default; set a strong, unique value. If you cannot rotate it yet (e.g. it protects existing encrypted data or active sessions), set ALLOW_INSECURE_DEFAULT_SECRETS=1 to boot while you migrate.";
110
110
111
+
/** Optional int env var; blank/whitespace normalises to undefined (z.coerce turns "" into 0). */
Copy file name to clipboardExpand all lines: docs/self-hosting/env/webapp.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,11 @@ mode: "wide"
26
26
|`DATABASE_CONNECTION_LIMIT`| No | 10 | Max DB connections. |
27
27
|`DATABASE_POOL_TIMEOUT`| No | 60 | DB pool timeout (s). |
28
28
|`DATABASE_CONNECTION_TIMEOUT`| No | 20 | DB connect timeout (s). |
29
+
|`DATABASE_WRITER_POOL_TIMEOUT`| No |`DATABASE_POOL_TIMEOUT`| Writer pool timeout (s); overrides the shared default for the writer only. |
30
+
|`DATABASE_WRITER_CONNECTION_TIMEOUT`| No |`DATABASE_CONNECTION_TIMEOUT`| Writer connect timeout (s); overrides the shared default for the writer only. |
29
31
|`DATABASE_READ_REPLICA_URL`| No |`DATABASE_URL`| Read-replica DB string. |
32
+
|`DATABASE_READ_REPLICA_POOL_TIMEOUT`| No |`DATABASE_POOL_TIMEOUT`| Read-replica pool timeout (s); overrides the shared default for the replica only. |
33
+
|`DATABASE_READ_REPLICA_CONNECTION_TIMEOUT`| No |`DATABASE_CONNECTION_TIMEOUT`| Read-replica connect timeout (s); overrides the shared default for the replica only. |
0 commit comments