Skip to content

[Backend] pg.Pool created without max / idle / connection / statement timeout settings #837

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Labels: enhancement, backend, Stellar Wave, database

The pg pool is created with zero tuning, so under load it can exhaust connections and a slow query can hang forever.

backend/src/lib/prisma.ts:13 (and prisma/seed.ts:6) do new pg.Pool({ connectionString }) with no max, idleTimeoutMillis, connectionTimeoutMillis or statement_timeout. That leaves the node-postgres defaults in place: max 10 and no statement timeout. When traffic picks up the pool can run dry, and one slow query with no statement_timeout will hold a request handler open indefinitely.

What the fix has to hold to

  • pool size and timeouts are env-configurable with sensible defaults
  • a slow query can't hang a handler forever (statement_timeout applied)
  • the new vars are documented

Done when

  • pool size and timeouts made env-configurable with sane defaults
  • new vars documented in backend/.env.example
  • limits confirmed applied at runtime
  • tests + CI green

Where to start
backend/src/lib/prisma.ts and backend/prisma/seed.ts. Small change, mostly a config object plus env plumbing and the .env.example entries.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programbackendBackend related tasksdatabasePostgreSQL / PrismaenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions