private boolean checkCacheClosing(ClusterDistributionManager dm) {
    InternalCache cache = dm.getCache();
    return cache == null || cache.getCancelCriterion().isCancelInProgress();
  }
check to see if the cache is closing
geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegionFunctionStreamingMessage.java