Sockets, Threads, Connection Pool

Today one of our applications built on spring boot, has restarted itself ?!

2019-06-06 07:12:13.343 WARN 28148 --- [-AdminTaskTimer] c.m.v.a.ThreadPoolAsynchronousRunner : com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@2977f7fe -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!

We suspect that due to DB Connection Pool missconfiguration, it somehow run out of threads… threads pilled up waiting and the java process crashed…

So, here are some references related to this story

https://dzone.com/articles/threads-stuck-in-javanetsocketinputstreamsocketrea

What does SocketInputStream.socketRead0() API in Java do?


– I liked this article because it shows that DB Connections, HTTP Calls, RMI invocations… boiled down to Socket connection and a thread might be block/waiting on that connection

MySQL Connection Handling and Scaling


– this is such a nice article explaining the mysql connections, etc…

Leave a comment