Hazelcast client not able to reconnect after node has been down (HazelcastInstanceNotActiveException)

670 views
Skip to first unread message

Jørund Vier Skriubakken

unread,
May 11, 2016, 3:18:53 AM5/11/16
to Hazelcast
Hi!

I'm running in a  development environment with one Hazelcast node. This node I connect to from my Wildfly application server (a webapp).

If I terminate/shutdown the node and start it again while the application server is running, then the application server's client is not able to reconnect the node. It fails with the following exception:
Exception caught when handling a web request: com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is not active!
at com.hazelcast.client.impl.HazelcastClientProxy.getClient(HazelcastClientProxy.java:270)
at com.hazelcast.client.impl.HazelcastClientProxy.getMap(HazelcastClientProxy.java:113)

Is this expected behaviour? If so, could it be changed using properties? Or must I check LifeCycleService.isRunning() before every usage of the client? and if it's not running create a new client?

I'm running 3.6.2

Thanks for any help

ih...@hazelcast.com

unread,
May 11, 2016, 5:38:08 AM5/11/16
to Hazelcast
Hello,

Yes, it is expected behaviour. When node is down after the connect retry timeout, it will shutdown the client. Then, you should call start on the client again before trying to use it. 

You can also increase the timeout, e.g.:
<connection-attempt-period>3000</connection-attempt-period> (3 seconds) and <connection-attempt-limit>20</connection-attempt-limit> which means client will try to connect to members for 3*20=60 seconds. 

Regards,
ihsan

Jørund Vier Skriubakken

unread,
May 11, 2016, 6:06:48 AM5/11/16
to haze...@googlegroups.com
Hi and thanks for the response!

Yes, I've finally figured out about the connectionAttemtLimit and period.

However, that I'm able to call a method called start on the HazelcastInstance was new to me....and good news :) But, I cannot see the method!?

Cheers,
Jørund

--
You received this message because you are subscribed to a topic in the Google Groups "Hazelcast" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hazelcast/jh0otpJYKEA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/0cb29dd5-e29b-4ae7-bd92-ac0292bc1ae8%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

ih...@hazelcast.com

unread,
May 11, 2016, 12:56:24 PM5/11/16
to Hazelcast
Hello,

start is really not in the public interface, it is at HazelcastClientInstanceImpl, you can cast and do it but you may just obtain a new client instead.
Reply all
Reply to author
Forward
0 new messages