It was silly of me not to dump the stuck trace while catching the IOException from socket.accept() and shutting down the thread doing the accept... Having fixed this, I still want to understand how to deal with the situation when this call barfs.
My app is a classic socket server accepting hundreds of clients, sometimes thousands. Accepting thread is always up and blocked in accept() call. Once accepted, the separate thread gets launched to do the stuff and so on. Nothing special.
The question is, what should be done when accept() fails? Should this be considered as a permanent failure immediately? Should I retry to get into accept() for some time and try to get through? What's the best practice? And what normally the reasons for the IOException to be thrown?