Repository navigation
fix: preserve PostgreSQL failures through cleanup - #525
Conversation
✅ Deploy Preview for prisma-dart canceled.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe PostgreSQL driver now preserves the first SQL failure and its stack trace when rollback fails. Documentation describes PostgreSQL timeout settings and close behavior. Opt-in integration tests cover timeout handling, backend termination, and admitted work draining during close. ChangesPostgreSQL transaction recovery
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue remains from this review. Run the required real PostgreSQL CI checks before merging. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit watched the queries sleep, Comment |
Problem and behavior
A direct PostgreSQL callback could catch a backend failure and return, then automatic rollback replaced the original server error with “connection is not open”. Preserve the first issued SQL error and its stack when rollback also fails; still discard the broken connection. Callback failures retain their existing priority.
Raise the minimum native
postgresversion from 3.5.12 to 3.5.20. In a real isolated cancellation failure, the old version let a timed-out query succeed and emitted an unhandled SocketException. The new version reports a catchable failure, replaces the connection and completes subsequent work. Use the upstream cancellation and hard-timeout fixes rather than introducing an ORM timeout/retry layer. Upstream changelog documents the cancellation, cleanup and deadline corrections.Document native query/connect and server statement deadlines, including the application-callback boundary of close(). Public query APIs and generated clients remain unchanged.
Refs #516
Validation
57P01error and stack after the fix; before it returned the cleanup error.statement_timeout, native clientqueryTimeout, terminated transaction backend, caught direct-backend failure, and close while admitted work is interrupted. Each checks rollback, expired scopes, exact cause where relevant, connection replacement or close completion, and subsequent usable work. Termination targets only the backend observed executingpg_sleepthrough a separate control connection.Summary by CodeRabbit