Skip to content

Commit

Permalink
ISPN-10912 HotRod server retries CheckAddressTask indefinitely during…
Browse files Browse the repository at this point in the history
… shutdown
  • Loading branch information
danberindei authored and wburns committed Nov 12, 2019
1 parent 34ca228 commit 7ebe574
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import org.infinispan.AdvancedCache;
import org.infinispan.Cache;
import org.infinispan.commons.CacheException;
import org.infinispan.IllegalLifecycleStateException;
import org.infinispan.commons.dataconversion.MediaType;
import org.infinispan.commons.logging.LogFactory;
import org.infinispan.commons.marshall.Externalizer;
Expand Down Expand Up @@ -671,21 +671,18 @@ public void topologyChanged(TopologyChangedEvent<Address, ServerAddress> event)
}

private void recursionTopologyChanged() {
if (addressCache.getStatus().allowInvocations()) {
// Check the manager status, not the address cache status, because it changes to STOPPING first
if (cacheManager.getStatus().allowInvocations()) {
// No need for a timeout here, the cluster executor has a default timeout
clusterExecutor.submitConsumer(new CheckAddressTask(addressCache.getName(), clusterAddress), (a, v, t) -> {
if (t != null) {
throw new CacheException(t);
if (t != null && !(t instanceof IllegalLifecycleStateException)) {
log.debug("Error re-adding address to topology cache, retrying", t);
recursionTopologyChanged();
}
if (!v) {
log.debugf("Re-adding %s to the topology cache", clusterAddress);
addressCache.putAsync(clusterAddress, address);
}
}).whenComplete((v, t) -> {
if (t != null) {
log.debug("Error re-adding address to topology cache, retrying", t);
recursionTopologyChanged();
}
});
}
}
Expand Down

0 comments on commit 7ebe574

Please sign in to comment.