apache/hadoop · warning · InterruptedIOException

Router Federation Rename is interrupted while checking permi

Error message

Router Federation Rename is interrupted while checking permission.

What it means

While running the fed-rename permission check inside UserGroupInformation.doAs, an InterruptedException can surface (the underlying privileged action or RPC was interrupted). The code restores the interrupt flag and converts it to InterruptedIOException with this message so callers see a standard IO interruption rather than swallowing the interrupt.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterFederationRename.java:171

        String remoteUserName = NameNode.getRemoteUser().getShortUserName();
        UserGroupInformation proxyUser = UserGroupInformation
            .createProxyUser(remoteUserName,
                UserGroupInformation.getLoginUser());
        proxyUser.doAs((PrivilegedExceptionAction<Object>) () -> {
          checkRenamePermission(src, dst);
          return null;
        });
      } else {
        // In simple mode, check permission as remote user directly.
        checkRenamePermission(src, dst);
      }
    } catch (AccessControlException e) {
      throw new AccessControlException(
          "Permission denied rename " + src.getSrc() + "(" + src + ") to " + dst
              .getSrc() + "(" + dst + ") Reason=" + e.getMessage());
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new InterruptedIOException(
          "Router Federation Rename is interrupted while checking permission.");
    }
  }

  private void checkRenamePermission(RemoteLocation srcLoc,
      RemoteLocation dstLoc) throws IOException {
    // check src path permission.
    Path srcPath =
        new Path("hdfs://" + srcLoc.getNameserviceId() + srcLoc.getDest());
    srcPath.getFileSystem(conf).access(srcPath.getParent(), FsAction.WRITE);
    // check dst path permission.
    Path dstPath =
        new Path("hdfs://" + dstLoc.getNameserviceId() + dstLoc.getDest());
    dstPath.getFileSystem(conf).access(dstPath.getParent(), FsAction.WRITE);
  }

  static void checkSnapshotPath(RemoteLocation src, RemoteLocation dst)
      throws AccessControlException {

View on GitHub (pinned to 2add963021)

Solutions

  1. Check whether the router was shutting down or the RPC was cancelled; if so, retry after stability
  2. Tune client IPC timeouts if the permission check legitimately takes longer than the socket timeout (slow subcluster Namenodes)
  3. Preserve the interrupt in your own handling: the router already calls Thread.currentThread().interrupt(), so do not mask it in upstream code
Defensive patterns

Strategy: try-catch

Type guard

boolean isInterruption(IOException e) {
  return e instanceof InterruptedIOException
      && e.getMessage() != null
      && e.getMessage().contains("interrupted while checking permission");
}

Try / catch

try {
  routerFedRename.routerFedRename(src, dst, srcLocs, dstLocs);
} catch (InterruptedIOException iioe) {
  if (Thread.currentThread().isInterrupted() || iioe.getMessage().contains("checking permission")) {
    // router was shutting down or the RPC was cancelled: restore interrupt, retry later
    Thread.currentThread().interrupt();
    throw iioe;
  }
  throw iioe;
}

Prevention

When it happens

Trigger: The RPC thread performing routerFedRename is interrupted between the proxy-user doAs setup and the access checks: router shutdown, RPC client cancellation/timeout tearing down the handler, or admin tooling interrupting the call.

Common situations: Client-side timeout (dfs.client.socket-timeout / ipc) cancelling the RPC while the slow permission check runs; router restart during long-running renames; thread pools shutting down and interrupting in-flight handlers.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/2fa323adc04fec66. Report an issue: GitHub.