fix(db): Set db statement timeout of 90 seconds#4276
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@BugBot review |
PR SummaryMedium Risk Overview This is applied to both the shared Reviewed by Cursor Bugbot for commit f764497. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f764497. Configure here.
|
@BugBot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f764497. Configure here.
Greptile SummaryThis PR adds PostgreSQL session-level Confidence Score: 5/5Safe to merge — change is narrowly scoped, values are correct, and existing error handling propagates timeout errors appropriately. Both timeout values (90000 ms = 90 s) are correct per PostgreSQL spec, the postgres.js connection.options API is used correctly, and the inline comment already calls out the migration override requirement. No logic changes; all remaining observations are P2 or lower. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant App as Application Code
participant Client as postgres.js Client
participant PG as PostgreSQL
App->>Client: new postgres(connectionString, options)
Client->>PG: Startup with statement_timeout=90000ms and idle_in_transaction_session_timeout=90000ms
PG-->>Client: Session GUCs set
App->>PG: BEGIN transaction
alt Statement runs longer than 90s
PG-->>App: ERROR 57014 query_canceled (statement_timeout)
else Transaction idle longer than 90s
PG-->>App: ERROR 57P05 idle_in_transaction_session_timeout
else Normal execution
PG-->>App: Result set
App->>PG: COMMIT
end
Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile |
Summary
We've seen db queries with locks of over 70 minutes. We should set a maximum transaction limit to prevent hogging db resources.
Type of Change
Testing
Checklist
Screenshots/Videos