HikariCP icon indicating copy to clipboard operation
HikariCP copied to clipboard

Connection Timeout - Not able to connect to AWS Redshift HikariCP

Open dotsanjay opened this issue 2 years ago • 1 comments

@brettwooldridge,

Background: I am facing a very strange issue. I have a SpringBoot report generator app running as a Docker container and it connects to AWS Redshift to fetch the report data.

Here's what happening.

  1. Trigger report generation (Right after spinning the docker container, very first request) - Everything works fine.

  2. Subsequent report generation requests - the app tries to connect to the Redshift and hits HikariPool.getConnection() method and it starts logging connection is dead until we see the connection timeout error. Also, along with the connection is dead things it keeps on printing “adding” and “closing” connections in the log until it finally throws the connection timeout error.

I tried default Hikari config as well as different permutations and combinations of Hikari settings but it's the same - connectionTimeout error right after whatever connectionTimeout setting I have in the Hikari config.

And, if I handle the error via try-catch block and retry to connect, then it is running fine. Also, If I set minimumIdle less than maxpoolSize (minimumIdle=2, maxpoolSize=20), it works. Although it hands out dead connections it works.

github-screenshot

dotsanjay avatar Dec 08 '21 03:12 dotsanjay

which version did you use?may be the latest have fixed that issue

wangdengwu avatar Dec 10 '21 06:12 wangdengwu