Skip to content

Commit 472b879

Browse files
authored
[CueBot] Fix hitaki data-source outdated attributes (#1861)
The server has been reporting the warning bellow. This configuration change replaces `maxAge` with `max-lifetime`. Besides that, new attributes were added to handle idle connections, leaks and pool size. ``` HikariPool-1 - Failed to validate connection org.postgresql.jdbc.PgConnection@27e38df7 (This connection has been closed.). Possibly consider using a shorter maxLifetime value. ``` Signed-off-by: Diego Tavares <[email protected]>
1 parent f52cd14 commit 472b879

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

cuebot/src/main/resources/opencue.properties

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,29 @@ datasource.cue-data-source.driver-class-name=org.postgresql.Driver
55
datasource.cue-data-source.jdbc-url=jdbc:postgresql://dbhost/dbname
66
datasource.cue-data-source.username=cue
77
datasource.cue-data-source.password=password
8-
# Discard connections after 6 hours, this allows for gradual
9-
# connection rebalancing.
10-
datasource.cue-data-source.maxAge=21600000
8+
9+
# HikariCP Configuration
10+
# Maximum lifetime of a connection in milliseconds (5 hours = 18000000 ms)
11+
# This should be shorter than PostgreSQL's connection timeout
12+
datasource.cue-data-source.max-lifetime=18000000
13+
14+
# Maximum time to wait for a connection from the pool (30 seconds)
15+
datasource.cue-data-source.connection-timeout=30000
16+
17+
# Maximum time a connection can remain idle (10 minutes)
18+
datasource.cue-data-source.idle-timeout=600000
19+
20+
# Minimum number of idle connections to maintain
21+
datasource.cue-data-source.minimum-idle=5
22+
23+
# Maximum number of connections in the pool
24+
datasource.cue-data-source.maximum-pool-size=20
25+
26+
# Connection test query to validate connections
27+
datasource.cue-data-source.connection-test-query=SELECT 1
28+
29+
# How often to check for idle connections that can be evicted (30 seconds)
30+
datasource.cue-data-source.leak-detection-threshold=30000
1131

1232
grpc.cue_port=${CUEBOT_GRPC_CUE_PORT:8443}
1333
grpc.rqd_server_port=${CUEBOT_GRPC_RQD_SERVER_PORT:8444}
@@ -213,4 +233,4 @@ frame.finished_jobs_readonly=false
213233
# Enable Prometheus metrics collecting module
214234
metrics.prometheus.collector=false
215235
# What environment variable to use to acquire the deployment environment id (et. dev, prod, staging)
216-
metrics.prometheus.environment_id.environment_variable=DEPLOYMENT_ENVIRONMENT
236+
metrics.prometheus.environment_id.environment_variable=DEPLOYMENT_ENVIRONMENT

0 commit comments

Comments
 (0)