Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Deadlock on hazelcast client shutdown #466
we have run into a deadlock issue with hazelcast client. From what I could gather, when the shutdown starts (initiated by Spring's shutdown hook) the connection manager is closed as the first step in the shutdown cycle.
After that, but before the in and out runnables are shutdown, the out runnable detects that the connection is down and tries to recover it (OutRunnable#clusterIsDown()), which of course fails because the connection manager has already shut down. Since it can't recover the connection, it calls lifecycleService#shutdown() which blocks waiting for the lock.
This scenario causes that the client never finishes shutdown, since the customRun method in the OutRunnable is blocking for a shutdown call that can never finish.