Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Listeners fails if a member is removed in progress #10595

Closed
sancar opened this issue May 16, 2017 · 0 comments
Closed

Adding Listeners fails if a member is removed in progress #10595

sancar opened this issue May 16, 2017 · 0 comments

Comments

@sancar
Copy link
Member

@sancar sancar commented May 16, 2017

Adding listeners fail with following exception in this case:

com.hazelcast.core.HazelcastException: Listener can not be added
	at com.hazelcast.client.spi.impl.listener.ClientSmartListenerService$1.call(ClientSmartListenerService.java:81)
	at com.hazelcast.client.spi.impl.listener.ClientSmartListenerService$1.call(ClientSmartListenerService.java:67)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
	at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64)
	at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80)
Caused by: com.hazelcast.spi.exception.TargetDisconnectedException: Connection closed by the other side
	at com.hazelcast.client.spi.impl.ClientInvocationServiceSupport$CleanResourcesTask.notifyException(ClientInvocationServiceSupport.java:229)
	at com.hazelcast.client.spi.impl.ClientInvocationServiceSupport$CleanResourcesTask.run(ClientInvocationServiceSupport.java:214)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at com.hazelcast.util.executor.LoggingScheduledExecutor$LoggingDelegatingFuture.run(LoggingScheduledExecutor.java:128)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
	at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64)
	at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80)
	at ------ submitted from ------.(Unknown Source)
	at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveAndThrowIfException(ClientInvocationFuture.java:93)
	at com.hazelcast.client.spi.impl.ClientInvocationFuture.resolveAndThrowIfException(ClientInvocationFuture.java:33)
	at com.hazelcast.spi.impl.AbstractInvocationFuture.get(AbstractInvocationFuture.java:155)
	at com.hazelcast.client.spi.impl.listener.ClientSmartListenerService.invoke(ClientSmartListenerService.java:113)
	at com.hazelcast.client.spi.impl.listener.ClientSmartListenerService.access$200(ClientSmartListenerService.java:47)
	at com.hazelcast.client.spi.impl.listener.ClientSmartListenerService$1.call(ClientSmartListenerService.java:77)
	... 9 more
Caused by: java.io.EOFException: Remote socket closed!
	at com.hazelcast.internal.networking.nonblocking.NonBlockingSocketReader.handle(NonBlockingSocketReader.java:153)
	at com.hazelcast.internal.networking.nonblocking.NonBlockingIOThread.handleSelectionKey(NonBlockingIOThread.java:347)
	at com.hazelcast.internal.networking.nonblocking.NonBlockingIOThread.handleSelectionKeys(NonBlockingIOThread.java:332)
	at com.hazelcast.internal.networking.nonblocking.NonBlockingIOThread.selectLoop(NonBlockingIOThread.java:250)
	at com.hazelcast.internal.networking.nonblocking.NonBlockingIOThread.run(NonBlockingIOThread.java:203)

As a solution,
After getting the exception, we could check if connection is there or not. This way, we can continue without throwing exception to user, when a member closed in progress of adding listeners.

@sancar sancar added this to the 3.8.3 milestone May 16, 2017
@sancar sancar self-assigned this May 16, 2017
sancar added a commit to sancar/hazelcast that referenced this issue Jun 1, 2017
Add/remove listener sends invocation to all members in cluster in
smart routing. If one of the invocations can not be done, we were
failing related operation completely.

If invocation can not be done because connection is disconnected,
then that invocation can be ignored safely. No need to fail add/removeListener
action.

fixes hazelcast#10595
sancar added a commit to sancar/hazelcast that referenced this issue Jun 1, 2017
Add/remove listener sends invocation to all members in cluster in
smart routing. If one of the invocations can not be done, we were
failing related operation completely.

If invocation can not be done because connection is disconnected,
then that invocation can be ignored safely. No need to fail add/removeListener
action.

fixes hazelcast#10595
@sancar sancar closed this in #10681 Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.