Hi,
I am calling login method using slick , it works normal , but after some time delay , it gets hanged it is not sending any response
if i am using logger , i am getting like this:
[debug] a.a.RepointableActorRef - Aborting tcp connection to /0:0:0:0:0:0:0:1:51838 because of upstream failure: akka.http.impl.engine.HttpIdleTimeoutEx
ception: HTTP idle-timeout encountered, no bytes passed in the last 75000000000 nanoseconds. This is configurable by akka.http.[server|client].idle-time
out.
The connection is closed.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:227)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:796)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.setNetworkTimeout(SQLServerConnection.java:4768)
at com.zaxxer.hikari.pool.PoolBase.setNetworkTimeout(PoolBase.java:494)
at com.zaxxer.hikari.pool.PoolBase.quietlyCloseConnection(PoolBase.java:130)
at com.zaxxer.hikari.pool.HikariPool$1.run(HikariPool.java:414)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Are you setting connection idle or timeout values for your DB connections? I ran into something similar with MongoDB where the hosted MongoDB service will automatically close the socket on their end after a few minutes of inactivity, which would cause errors on the application’s end, as it still thinks the connections are open (or something to that effect). Once I added connection timeout and idle settings, the errors went away.
I am not familiar with SQL Server, does it have any special flags for timeouts, disconnect/reconnect in its connection string? e.g. I know MySQL has something like that called autoReconnect=true in its connection string.
You have a connection leak. Are you accessing the connection manually and not releasing it? Try to configure HikariCP’s leakDetectionThreshold to confirm that.
Your thread pool configuration for Slick is not consistent with your database connection pool. See Slick docs here.