{"record":{"id":"2fa323adc04fec66","repo":"apache/hadoop","slug":"router-federation-rename-is-interrupted-while-chec","errorCode":null,"errorMessage":"Router Federation Rename is interrupted while checking permission.","messagePattern":"Router Federation Rename is interrupted while checking permission\\.","errorType":"exception","errorClass":"InterruptedIOException","httpStatus":null,"severity":"warning","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterFederationRename.java","lineNumber":171,"sourceCode":"        String remoteUserName = NameNode.getRemoteUser().getShortUserName();\n        UserGroupInformation proxyUser = UserGroupInformation\n            .createProxyUser(remoteUserName,\n                UserGroupInformation.getLoginUser());\n        proxyUser.doAs((PrivilegedExceptionAction<Object>) () -> {\n          checkRenamePermission(src, dst);\n          return null;\n        });\n      } else {\n        // In simple mode, check permission as remote user directly.\n        checkRenamePermission(src, dst);\n      }\n    } catch (AccessControlException e) {\n      throw new AccessControlException(\n          \"Permission denied rename \" + src.getSrc() + \"(\" + src + \") to \" + dst\n              .getSrc() + \"(\" + dst + \") Reason=\" + e.getMessage());\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new InterruptedIOException(\n          \"Router Federation Rename is interrupted while checking permission.\");\n    }\n  }\n\n  private void checkRenamePermission(RemoteLocation srcLoc,\n      RemoteLocation dstLoc) throws IOException {\n    // check src path permission.\n    Path srcPath =\n        new Path(\"hdfs://\" + srcLoc.getNameserviceId() + srcLoc.getDest());\n    srcPath.getFileSystem(conf).access(srcPath.getParent(), FsAction.WRITE);\n    // check dst path permission.\n    Path dstPath =\n        new Path(\"hdfs://\" + dstLoc.getNameserviceId() + dstLoc.getDest());\n    dstPath.getFileSystem(conf).access(dstPath.getParent(), FsAction.WRITE);\n  }\n\n  static void checkSnapshotPath(RemoteLocation src, RemoteLocation dst)\n      throws AccessControlException {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterFederationRename.java#L153-L189","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check whether the router was shutting down or the RPC was cancelled; if so, retry after stability","Tune client IPC timeouts if the permission check legitimately takes longer than the socket timeout (slow subcluster Namenodes)","Preserve the interrupt in your own handling: the router already calls Thread.currentThread().interrupt(), so do not mask it in upstream code"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"boolean isInterruption(IOException e) {\n  return e instanceof InterruptedIOException\n      && e.getMessage() != null\n      && e.getMessage().contains(\"interrupted while checking permission\");\n}","tryCatchPattern":"try {\n  routerFedRename.routerFedRename(src, dst, srcLocs, dstLocs);\n} catch (InterruptedIOException iioe) {\n  if (Thread.currentThread().isInterrupted() || iioe.getMessage().contains(\"checking permission\")) {\n    // router was shutting down or the RPC was cancelled: restore interrupt, retry later\n    Thread.currentThread().interrupt();\n    throw iioe;\n  }\n  throw iioe;\n}","preventionTips":["Set client IPC/socket timeouts above the expected duration of permission checks over slow subclusters","Avoid issuing renames while the router is shutting down or restarting","Honor the interrupt flag in upstream handlers - the router already restored it for you"],"tags":["hdfs","router","federation","rename","interrupted","shutdown"],"backgroundTag":"operation-interrupted","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}