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

ISPN-10912 HotRod server retries CheckAddressTask indefinitely during shutdown #7550

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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