We experienced several deadlocks between the ThreadPool and one of the Worker threads in 2.1.7. As a result the indication listener freezes completely and worse the accept loops keeps running and creates socket after socket so that the JVM finally runs out of file handles. We saw this on RHEL 5.5 x86_64 Linux with an IBM 32bit 126.96.36.199 JVM.
I fixed a deadlock in the same classes four years ago. Code analysis does not reveal how this deadlock could happen, but maybe the Java Memory Model plays a trick here. However the design with two classes requiring locks of each other is fragile. I prepared a patch that will change the design so that we get rid of the bidirectional locking completely. I also made the connection queue the accept loop writes into bounded, so that even if the workers die we do not continuously leak sockets anymore.
Patch follows soon.
Log in to post a comment.