-
Notifications
You must be signed in to change notification settings - Fork 711
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
Expose Postgres database connection configuration properties including max connection lifetime #321
Comments
Here's the relevant code from
Looks like all we need to do is expose that API. PR incoming... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Configuring the max lifetime for the Postgres database connection type, and likely all others, like maxLifetime in HikariCP would allow for regular connection cycling on a configured lifetime duration. I believe the default is "0" in the database/sql library, or infinite lifetimes.
PQ says it "Handles bad connections for database/sql" and line 727 func TestCloseBadConn seems to indicate PQ will recover from bad connections, that seem to last for an infinite timeframe, though I have seen in production stale connection pools not recycle stale connections. If we have access to the underlying configuration properties then we can manually configure the connection lifecycle.
The configuration properties I have in mind are as indicated in this article:
The text was updated successfully, but these errors were encountered: