public boolean checkDSClosing(ClusterDistributionManager dm) {
    InternalDistributedSystem ds = dm.getSystem();
    return (ds == null || ds.isDisconnecting());
  }
check to see if the distributed system is closing

@return true if the distributed system is closing
geode-core/src/main/java/org/apache/geode/internal/cache/tx/RemoteOperationMessage.java