-
Notifications
You must be signed in to change notification settings - Fork 42
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
Enable Hikari connection timeout to be set via environment variable #17425
base: main
Are you sure you want to change the base?
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
@@ -1414,10 +1415,7 @@ class DatabaseAccess(val create: DSLContext) : Logging { | |||
config.addDataSourceProperty("cachePrepStmts", "true") | |||
config.addDataSourceProperty("prepStmtCacheSize", "250") | |||
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048") | |||
config.addDataSourceProperty( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code was setting connection timeout to 60sec but in staging and prod the effective timeout was 30 seconds. So, I deleted this chunk of code and set the connection timeout via the connectionTimeout property, hoping this will fix the issue.
See the incident report linked in the PR description for more details.
@@ -102,6 +103,11 @@ val dbUrl = ( | |||
?: System.getenv(KEY_DB_URL) | |||
?: "jdbc:postgresql://localhost:5432/prime_data_hub" | |||
) as String | |||
val hikariConfigTimeout = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default to 60 seconds if not set in env var
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, but please test thoroughly before prod deployment.
This PR updates application code, gradle, and terraform to allow the hikari connection timeout to be set via environment variable. This also fixes a bug where the configured connection timeout was not being respected.
Test Steps:
0. @devopsmatt to verify and validate TF changes
Changes