private boolean needAbandonRetries(int statusCode, String action) {
    if (statusCode == KeeperException.Code.SESSIONEXPIRED.intValue()) {
      LOG.error("ZK session expired. Master is expected to shut down. Abandoning retries for "
        + "action=" + action);
      return true;
    }
    return false;
  }
Helper function to check whether to abandon retries in ZooKeeper AsyncCallback functions
@param statusCode integer value of a ZooKeeper exception code
@param action     description message about the retried action
@return true when need to abandon retries otherwise false
hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitLogManagerCoordination.java