HikariForAurora - Failed to validate connection org.mariadb.jdbc.MariaDbConnection (Connection.setNetworkTimeout cannot be called on a closed connection)
이건은 지난번 포스트와 동일하다.
https://eclipse4j.tistory.com/264
다시한번, 써보면...
DB의 Global time_wait는 60초 입니다. 60초 내에 연결이 없는 경우 세션을 종료 시키게 됨.
(기본값은 8시간)
hikaricp의 maxlife시간은 훨씬 긴 시간을 가지고 있기 때문에 끊어졌던 pool을 찾으려고 하지만 이미 종료되었기 때문에 나는 경고.
똑같은 설정으로 로컬 재현을 해보면
set GLOBAL wait_timeout = 30;
[2019-06-20 22:51:41] [http-nio-7001-exec-8] [INFO ] [c.b.p.s.common.logging.LoggingFilter] -
[2019-06-20 22:51:50] [http-nio-7001-exec-4] [INFO ] [c.b.p.s.common.logging.LoggingFilter] -
[2019-06-20 22:54:03.584 WARN 51182 --- [nio-7001-exec-5] com.zaxxer.hikari.pool.PoolBase : HikariForAurora - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@3a0c61f1 (Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.
[2019-06-20 22:54:03] [http-nio-7001-exec-5] [WARN ] [com.zaxxer.hikari.pool.PoolBase] - HikariForAurora - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@3a0c61f1 (Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.
2019-06-20 22:54:03.585 WARN 51182 --- [nio-7001-exec-5] com.zaxxer.hikari.pool.PoolBase : HikariForAurora - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@134800bf (Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.
[2019-06-20 22:54:03] [http-nio-7001-exec-5] [WARN ] [com.zaxxer.hikari.pool.PoolBase] - HikariForAurora - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@134800bf (Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.
2019-06-20 22:54:03.586 WARN 51182 --- [nio-7001-exec-5] com.zaxxer.hikari.pool.PoolBase : HikariForAurora - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@414d4b17 (Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.
[2019-06-20 22:54:03] [http-nio-7001-exec-5] [WARN ] [com.zaxxer.hikari.pool.PoolBase] - HikariForAurora - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@414d4b17 (Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.
Hibernate:
22:51분에 접속 후, 22:54분에 재접속하면 동일한 오류가 발생.
이후 set GLOBAL wait_timeout = 3600; 으로 지정후 동일하게 실행하면!!
[2019-06-20 22:56:08] [http-nio-7001-exec-1] [INFO ] [c.b.p.s.common.logging.LoggingFilter] -
[2019-06-20 22:56:17] [http-nio-7001-exec-2] [INFO ] [c.b.p.s.common.logging.LoggingFilter] -
[2019-06-20 22:59:08] [http-nio-7001-exec-4] [INFO ] [c.b.p.s.common.logging.LoggingFilter] -
3분후, 재접속해도 별도의 경고메시지는 남지 않음.
혹시, DBA와 협의 후, wait_timeout을 수정할 수 없는 상황이라면.. CP의 타임아웃을 수정하자.