Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support idle_in_transaction_session_timeout and statement_timeout for native driver #2323

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shayonj
Copy link

@shayonj shayonj commented Aug 30, 2020

Right now when using pg with pg-native the config options
idle_in_transaction_session_timeout and statement_timeout
do not get applied. This is due to, when building the connection
string for native driver these options aren't passed in.

I took advantage of options conn parameter and passed both the config options
into it using -c which postgres supports. This builds on top of the work happened in #2216.

Also fixes #2103

Also added some tests. Very much open to feedback and comments :).

@shayonj shayonj force-pushed the s/lib-native-options branch 2 times, most recently from 4cc6167 to 1bda055 Compare August 30, 2020 01:27
@shayonj shayonj changed the title Support idle_in_transaction_session_timeout and statement for native driver Support idle_in_transaction_session_timeout and statement_timeout for native driver Aug 30, 2020
@vhmth
Copy link

vhmth commented Aug 31, 2020

An expedient (and better review than what I could offer myself) would be super appreciated here. 🙏 Supporting good timeouts is critical for us to run the native driver in production at Loom. ❤️

@brianc
Copy link
Owner

brianc commented Oct 4, 2020

Yo - sorry I was late to the party here. Left a question on here....could we include a test when both options and statement_timeout is included? Once we got that I can merge & release a new minor ver.

… native driver

Right now when using `pg` with `pg-native` the config options
`idle_in_transaction_session_timeout` and `statement_timeout`
do not get applied. This is due to, when building the connection
string for native driver these options aren't passed in.

I took advantage of `options` conn parameter and passed both the config options
into it using `-c` which postgres supports. This builds on top of the work happened in <TBD LINK>.

Also added some tests. Very much open to feedback and comments :).
@shayonj
Copy link
Author

shayonj commented Oct 24, 2020

late to the part myself this time, thanks @brianc for the review, updated with some more spec 🙌
(had to force push due to the rebase w/ upstream)

@machuga
Copy link

machuga commented Apr 11, 2021

Hi, @brianc!

Is this PR still under consideration? Having this fully supported would be great. We are moving more of our libraries at work toward using pg-native (and I submitted a PR to add pg-native to `knex) due to running into the same performance issues here #1993.

Thanks for all your fantastic work on these libraries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

native driver ignores statement_timeout
4 participants