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
Cluster is in PASSIVE state! vs TargetDisconnectedException 3.7-SNAP #8261
while testing hzInstance.getCluster().shutdown(); on 3.6.3 and 3.7-SANPSHOT
using a 4 node cluster, with 4 clients making putAll ops.
during which we call, hzInstance.getCluster().shutdown(); from one member of the cluster
with 3.6.3 clients get
with 3.7-SANPSHOT clients get
so me it seem 3.6.3, is correct, and exception given in 3.7-SANPSHOT is misleading
3.6.3 member log example
and 3.7-SANPSHOT member log example
I examined the problem. Recently, we added a cleaner thread that sets the invocation result for connections that are either disconnected (not live) or heartbeatFailed. Line https://github.com/hazelcast/hazelcast/blob/master/hazelcast-client/src/main/java/com/hazelcast/client/spi/impl/ClientInvocationServiceSupport.java#L203, may return false not only because the connection heartbeat fails but also during connection close where the live flag is set to false (https://github.com/hazelcast/hazelcast/blob/master/hazelcast-client/src/main/java/com/hazelcast/client/connection/nio/ClientConnection.java#L219). Hence, can set the invocation result for a more appropriate exception based on these two different cases.
A Suggestion for the fix:
The solution will not produce the IllegalStateException as written above. This is an exception by server side, which is propagated at the client as the response to putAll. This shall still occur, but depending on if it comes before the CleanResourcesTask runs. If CleanResourcesTask runs first it shall be the exceptions as we proposed above, otherwise it may be the IllegalStateException.