private static boolean recoverLease(final FileSystem dfs, final int nbAttempt, final Path p,
    final long startWaiting) throws FileNotFoundException {
    boolean recovered = false;
    try {
      recovered = (Boolean) recoverLeaseMethod.invoke(dfs, p);
      LOG.info((recovered ? "Recovered lease, " : "Failed to recover lease, ")
        + getLogMessageDetail(nbAttempt, p, startWaiting));
    } catch (InvocationTargetException ite) {
      final Throwable e = ite.getCause();
      if (e instanceof LeaseExpiredException && e.getMessage().contains("File does not exist")) {
        // This exception comes out instead of FNFE, fix it
        throw new FileNotFoundException("The given WAL wasn't found at " + p);
      } else if (e instanceof FileNotFoundException) {
        throw (FileNotFoundException) e;
      }
      LOG.warn(getLogMessageDetail(nbAttempt, p, startWaiting), e);
    } catch (IllegalAccessException e) {
      LOG.error("Failed to call recoverLease on {}. Abort.", dfs, e);
      throw new RuntimeException(e);
    }
    return recovered;
  }
Try to recover the lease.
@return True if dfs#recoverLease came by true.
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/util/RecoverLeaseFSUtils.java