GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(db): revert statement_timeout startup options breaking pooled connections by waleedlatif1 · Pull Request #4284 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

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

  • Bug fix

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
All reactions
  • 👍 1 reaction
@waleedlatif1
fix(db): revert statement_timeout startup options breaking pooled con…
b660e34
…nections
@vercel

vercel Bot commented Apr 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Building Building Preview, Comment Apr 24, 2026 6:31am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Apr 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 merged commit ccb5f1e into staging Apr 24, 2026
9 of 10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the waleedlatif1/app-loading-issue branch April 24, 2026 06:31
waleedlatif1 added a commit that referenced this pull request Apr 24, 2026
@waleedlatif1
Merge pull request #4285 from simstudioai/staging
3422f64
fix(db): revert statement_timeout startup options breaking pooled connections (#4284)
@greptile-apps

greptile-apps Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview April 24, 2026 06:36
View deployment

This branch was successfully deployed

1 active deployment
Preview — b660e34b Deployed Apr 24, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

1 participant

@waleedlatif1
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.