Running VIP Authentication Hub, the admin and azserver pods report trying to use an already closed connection to request the PostgreSQL database, and it reports the error:
spring.write.datasource - Failed to validate connection org.postgresql.jdbc.PgConnection@8596a90 (This connection has been closed.). Possibly consider using a shorter maxLifetime value."
Oct 29 09:42:59 <namespace>-ssp-admin-<number> ssp-admin warn
{
"timestamp":"2024-10-29T08:42:59.765155Z",
"type":"log",
"level":"warn",
"thread":"https-jsse-nio-8083-exec-3",
"msg":"spring.write.datasource - Failed to validate connection org.postgresql.jdbc.PgConnection@8596a90 (This connection has been closed.). Possibly consider using a shorter maxLifetime value."}
Oct 29 09:43:29 <namespace>-ssp-azserver-<number> ssp-azserver warn
{
"timestamp":"2024-10-29T08:43:29.835149Z",
"type":"log",
"level":"warn",
"thread":"https-jsse-nio-8085-exec-4",
"msg":"spring.write.datasource - Failed to validate connection org.postgresql.jdbc.PgConnection@4a9a8bf8 (This connection has been closed.). Possibly consider using a shorter maxLifetime value."}
It seems the client tries to use an already closed connection.
Use the Database connection pool parameter to fine tune the connections to avoid that problem (1).
Database Connection Pool
For its operational database, VIP Authentication Hub supports the use of Database Connection Pool configured at the time of deploying the VIP Authentication Hub chart.
The defaults are maintained in VIP Authentication Hub helm chart's values.yaml.
The connection pool parameters that can be passed while deploying Authentication Hub (ssp) helm chart using --set <name>="<value>" helm parameters, are as follows:
| DB Pool Config Value | Default | Description |
|---------------------------------------+---------+-------------------------------------------------------------|
| ssp.global.db.maxPoolSizeRead | 200 | Max number of database connections for reads |
| ssp.global.db.maxPoolSizeWrite | 200 | Max number of database connections for writes |
| ssp.global.db.minIdleSize | 5 | Minimum number of idle database connections |
| ssp.global.db.connectionTimeoutMillis | 30000 | Maximum amount of time to wait for a database connection |
| | | in milliseconds |
| ssp.global.db.idleTimeoutMillis | 12000 | Maximum lifetime of an idle database connection |
| | | before its closed, in milliseconds |
| ssp.global.db.maxLifetimeMillis | 1800000 | Maximum lifetime of a database connection, in milliseconds. |
| | | Usually this number should be less than the firewall's |
| | | TCP keepalive timeout if one is present. |