PG write query timeouts - #321
Merged
Merged
Conversation
suddendust
requested review from
avinashkolluru,
kotharironak,
puneet-traceable,
skjindal93 and
suresh-prakash
as code owners
August 13, 2026 04:51
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
============================================
+ Coverage 81.04% 81.06% +0.01%
- Complexity 1615 1617 +2
============================================
Files 243 243
Lines 7650 7656 +6
Branches 754 755 +1
============================================
+ Hits 6200 6206 +6
Misses 960 960
Partials 490 490
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| if (queryTimeoutSeconds > 0) { | ||
| preparedStatement.setQueryTimeout(queryTimeoutSeconds); | ||
| } | ||
| return preparedStatement; |
There was a problem hiding this comment.
Is this set per prepared statement? or is it possible to set it at connection?
Contributor
Author
There was a problem hiding this comment.
So it's a bit nuanced. There're three ways to do this:
- Set it in PS - Like what we're doing here. In this case, the driver cancels the query by sending a new cancel request to the server.
- Set it at a connection level - By setting
SET statement_timeout = 60sin the connection pool config. However, this might pin connections at the proxy (usingSETcommands does but the doc is not very clear on whetherSET statement_timeoutwill do this). - Set it in the RDS parameter group. This applies this timeout to any client regardless of what they've configured. Client can still use
setQueryTimeoutto set a value lesser than the global value in the param group.
Given our issues with pinning, I'll go with 1 + 3.
puneet-traceable
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR sets query timeout for write APIs in
FlatPostgresCollection.Testing
Added an integration test
Checklist: