The Transaction already closed: A commit cannot be executed on a transaction that was rolled back error (P2028) fires when Prisma's implicit transaction is rolled back mid-operation (connection blip, deadlock) and a commit is attempted on the closed transaction. Like the P2028 Unable to start a transaction variant, it is transient — the next scheduled tick reclaims a fresh connection and retries.
Changes
Add isPrismaTransactionClosed to pg.ts — matches the Transaction already closed message variant of P2028
Check isPrismaTransactionClosed before the broad isPrismaTransactionTimeout (which matches all P2028 codes) in the SportsWorker tick handler
Log at info with an accurate message instead of warn-paging the error loop
Add tests for the new helper
Testing
vitest run apps/api/src/lib/pg.test.ts — 26 tests pass
pnpm --filter ./apps/api typecheck — passes
Paperclip-Issue: BIT-32810
## Summary
The Transaction already closed: A commit cannot be executed on a transaction that was rolled back error (P2028) fires when Prisma's implicit transaction is rolled back mid-operation (connection blip, deadlock) and a commit is attempted on the closed transaction. Like the P2028 Unable to start a transaction variant, it is transient — the next scheduled tick reclaims a fresh connection and retries.
## Changes
- Add isPrismaTransactionClosed to pg.ts — matches the Transaction already closed message variant of P2028
- Check isPrismaTransactionClosed before the broad isPrismaTransactionTimeout (which matches all P2028 codes) in the SportsWorker tick handler
- Log at info with an accurate message instead of warn-paging the error loop
- Add tests for the new helper
## Testing
- vitest run apps/api/src/lib/pg.test.ts — 26 tests pass
- pnpm --filter ./apps/api typecheck — passes
Paperclip-Issue: BIT-32810
The 'Transaction already closed: A commit cannot be executed on a
transaction that was rolled back' error (P2028) fires when Prisma's
implicit transaction is rolled back mid-operation (connection blip,
deadlock) and a commit is then attempted on the closed transaction.
Like the P2028 'Unable to start a transaction' variant, it is transient
— the next scheduled tick reclaims a fresh connection and retries.
Add isPrismaTransactionClosed to pg.ts and check it before the broad
isPrismaTransactionTimeout (which matches all P2028 codes) in the
SportsWorker tick handler, so the closed-transaction variant logs at
info with an accurate message instead of warn-paging the error loop.
Paperclip-Issue: BIT-32810
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The Transaction already closed: A commit cannot be executed on a transaction that was rolled back error (P2028) fires when Prisma's implicit transaction is rolled back mid-operation (connection blip, deadlock) and a commit is attempted on the closed transaction. Like the P2028 Unable to start a transaction variant, it is transient — the next scheduled tick reclaims a fresh connection and retries.
Changes
Testing
Paperclip-Issue: BIT-32810
auto-approve: CI success on
4ff13dbe8e(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
4ff13dbe8e(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
4ff13dbe8e(gitea_auto_approve_open_prs_once.py)