title: Hazelcast TargetNotMemberException: Not Member! target
body: <p>I have seen a lot of posts about a <code>com.hazelcast.spi.exception.TargetNotMemberException: Not Member! target:</code> </p>
  
  <p>But what to do in this cases? Question : Is possible to catch the exception and do "hazelCastInstance.shutdown()`"</p>
  
  <p>Also its possible to see in the "wrong node" continously :  "<em>Remaining migration tasks in queue => 1"</em></p>
  
  <p>Hazelcast 3.7  Cluster with two nodes.</p>
  
  <p>Complete StackTrace: </p>
  
  <pre><code>com.hazelcast.spi.exception.TargetNotMemberException: Not Member! target: [machine]:5704, partitionId: 0, operation: com.hazelcast.map.impl.query.QueryPartitionOperation, service: hz:impl:mapService
          at com.hazelcast.spi.impl.operationservice.impl.Invocation.initInvocationTarget(Invocation.java:324)
          at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvoke(Invocation.java:256)
          at com.hazelcast.spi.impl.operationservice.impl.Invocation.access$300(Invocation.java:94)
          at com.hazelcast.spi.impl.operationservice.impl.Invocation$InvocationRetryTask.run(Invocation.java:530)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
          at java.lang.Thread.run(Thread.java:682)
          at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76)
          at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92)
          at ------ submitted from ------.(Unknown Source)
          at com.hazelcast.spi.impl.operationservice.impl.InvocationFuture.resolve(InvocationFuture.java:111)
          at com.hazelcast.spi.impl.operationservice.impl.InvocationFuture.resolveAndThrow(InvocationFuture.java:74)
          at com.hazelcast.spi.impl.AbstractInvocationFuture.get(AbstractInvocationFuture.java:158)
          at com.hazelcast.map.impl.query.MapQueryEngineImpl.addResultsOfPredicate(MapQueryEngineImpl.java:605)
          at com.hazelcast.map.impl.query.MapQueryEngineImpl.invokeQueryAllPartitions(MapQueryEngineImpl.java:506)
          at com.hazelcast.map.impl.proxy.MapProxyImpl.entrySet(MapProxyImpl.java:633)
          at com.hazelcast.map.impl.proxy.MapProxyImpl.entrySet(MapProxyImpl.java:622)
          at myClass.getAll(MyClass.java:10)
  </code></pre>