Skip to content

fix(db): increase prisma transaction timeout from 30s to 60s#2633

Merged
tofikwest merged 1 commit intomainfrom
fix/increase-transaction-timeout
Apr 22, 2026
Merged

fix(db): increase prisma transaction timeout from 30s to 60s#2633
tofikwest merged 1 commit intomainfrom
fix/increase-transaction-timeout

Conversation

@tofikwest
Copy link
Copy Markdown
Contributor

@tofikwest tofikwest commented Apr 22, 2026

Summary

  • Bumps the default Prisma transactionOptions.timeout from 30s → 60s across all five Prisma clients (packages/db, apps/api, apps/app, apps/portal, apps/framework-editor).
  • Also bumps the one inline $transaction timeout override in apps/api/src/trigger/tasks/onboarding/migrate-policies-for-org.ts to stay consistent with the new default.

Why

Customers were unable to complete organization creation because the underlying transaction occasionally exceeds 30s and gets aborted. Raising the ceiling to 60s unblocks onboarding immediately.

Caveat / follow-up

This is a band-aid. A DB transaction that genuinely takes >30s holds locks and a connection for that entire duration and will cause contention / pool pressure at scale. The real fix is to investigate what is happening inside the org-creation transaction and move any non-DB work (external API calls, S3 uploads, email sends, heavy seeding) out of it. Tracking that separately.

Test plan

  • Verify org creation completes for the affected customers in staging
  • Confirm no regressions in other transactional flows (policy updates, task mutations, comments, ownership transfer)
  • Monitor for any increase in transaction duration or lock-wait alerts after deploy

🤖 Generated with Claude Code


Summary by cubic

Increase Prisma transaction timeout from 30s to 60s across all clients to prevent org creation timeouts and unblock onboarding.

  • Bug Fixes
    • Set transactionOptions.timeout to 60000 in packages/db, apps/api, apps/app, apps/portal, apps/framework-editor.
    • Updated the inline $transaction timeout in apps/api/src/trigger/tasks/onboarding/migrate-policies-for-org.ts to match.

Written for commit 8d1764a. Summary will update on new commits.

Customers were unable to complete organization creation when the underlying
transaction exceeded 30s. Bump the default transactionOptions.timeout across
all Prisma clients (and the migrate-policies-for-org trigger) to 60s to
unblock onboarding while the slow work is investigated separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

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

Project Deployment Actions Updated (UTC)
app Building Building Preview, Comment Apr 22, 2026 2:48pm
comp-framework-editor Building Building Preview, Comment Apr 22, 2026 2:48pm
portal Building Building Preview, Comment Apr 22, 2026 2:48pm

Request Review

@tofikwest tofikwest merged commit 3f781a8 into main Apr 22, 2026
8 of 11 checks passed
@tofikwest tofikwest deleted the fix/increase-transaction-timeout branch April 22, 2026 14:51
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.27.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants