GeezerVison is showing github.com — fix(db): revert statement_timeout startup options breaking pooled connections by waleedlatif1 · Pull Request #4284 · simstudioai/sim
Conversation
Summary
- Reverts fix(db): Set db statement timeout of 90 seconds #4276 —
connection.options startup params are incompatible with the PlanetScale/PgBouncer pooler (prod already runs prepare: false), killing every new DB connection
- Caused sign-in/social 500s, socket-token 500s, workspace UI stuck loading, and widespread "Failed query" errors in prod after v0.6.56 rolled out
- Will re-land as
SET LOCAL statement_timeout per-transaction (or via pooler-compatible URL param) in a follow-up
Type of Change
Testing
Tested manually — verified DB client opens without the broken startup options
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing
- No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Apr 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Medium Risk
Touches global Postgres client initialization; while the change is small, it impacts all DB connectivity and query/transaction behavior (timeouts no longer enforced at connection startup).
Overview
Reverts the use of Postgres connection.options startup parameters (e.g., statement_timeout, idle_in_transaction_session_timeout) in both the shared packages/db client and the realtime socket DB client.
This restores compatibility with poolers like PgBouncer/PlanetScale that reject these startup params, at the cost of no longer enforcing those server-side timeouts via connection initialization.
Reviewed by Cursor Bugbot for commit b660e34. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
waleedlatif1
added a commit
that referenced
this pull request
Apr 24, 2026
fix(db): revert statement_timeout startup options breaking pooled connections (#4284)
Greptile Summary
This PR reverts #4276 by removing the connection.options startup parameters (-c statement_timeout=90000 -c idle_in_transaction_session_timeout=90000) from both the main packages/db client and the realtime socketDb client. These options are incompatible with PgBouncer/PlanetScale session pooling, which broke every new DB connection in production after v0.6.56. The prepare: false flag, which is the correct PgBouncer compatibility setting, remains in place in both clients.
Confidence Score: 5/5
Safe to merge — minimal, targeted revert of a confirmed production regression with no logic changes.
The change removes exactly the two connection.options lines that caused connection failures with PgBouncer, leaves all other pool config intact, and has been manually verified. No custom rules are violated. The only trade-off (loss of server-side query timeout guards) is acknowledged and tracked for a follow-up.
No files require special attention.
Important Files Changed
| Filename |
Overview |
| packages/db/index.ts |
Removed incompatible connection.options startup params and their documentation comment; prepare: false retained for PgBouncer compatibility |
| apps/realtime/src/database/operations.ts |
Removed identical connection.options block from socketDb; pool config otherwise unchanged |
Sequence Diagram
sequenceDiagram
participant App as Application
participant Pool as PgBouncer/PlanetScale Pooler
participant DB as PostgreSQL
Note over App,DB: Before revert (broken)
App->>Pool: New connection request
Pool->>DB: Connect + send startup options (-c statement_timeout=90000 ...)
DB-->>Pool: ❌ Error: unrecognized option
Pool-->>App: Connection failed (500 errors)
Note over App,DB: After revert (this PR)
App->>Pool: New connection request (prepare: false)
Pool->>DB: Connect (no startup options)
DB-->>Pool: ✅ Connection established
Pool-->>App: Ready to query
Loading
Reviews (1): Last reviewed commit: "fix(db): revert statement_timeout startu..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch was successfully deployed
1 active
deployment
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|