{"record":{"id":"5267a4ecab33f1bf","repo":"apache/hadoop","slug":"unexpected-error-while-invoking-api","errorCode":null,"errorMessage":"Unexpected error while invoking API {}","messagePattern":"Unexpected error while invoking API (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java","lineNumber":1696,"sourceCode":"        futures = executorService.invokeAll(\n            callables, timeOutMs, TimeUnit.MILLISECONDS);\n      } else {\n        futures = executorService.invokeAll(callables);\n      }\n      return processFutures(method, m, orderedLocations, futures);\n    } catch (RejectedExecutionException e) {\n      if (rpcMonitor != null) {\n        rpcMonitor.proxyOpFailureClientOverloaded();\n      }\n      int active = executorService.getActiveCount();\n      int total = executorService.getMaximumPoolSize();\n      String msg = \"Not enough client threads \" + active + \"/\" + total;\n      LOG.error(msg);\n      throw new StandbyException(\n          \"Router \" + router.getRouterId() + \" is overloaded: \" + msg);\n    } catch (InterruptedException ex) {\n      LOG.error(\"Unexpected error while invoking API: {}\", ex.getMessage());\n      throw new IOException(\n          \"Unexpected error while invoking API \" + ex.getMessage(), ex);\n    } finally {\n      releasePermit(CONCURRENT_NS, ugi, method, controller);\n    }\n  }\n\n  /**\n   * Handle all futures during the invokeConcurrent call process.\n   *\n   * @param <T> The type of the remote location.\n   * @param <R> The type of the remote method return.\n   * @param method The remote method and parameters to invoke.\n   * @param m The method to invoke.\n   * @param orderedLocations List of remote locations to call concurrently.\n   * @param futures all futures during the invokeConcurrent call process.\n   * @return Result of invoking the method per subcluster (list of results),\n   *         This includes the exception for each remote location.\n   * @throws InterruptedException if the current thread was interrupted while waiting.","sourceCodeStart":1678,"sourceCodeEnd":1714,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java#L1678-L1714","documentation":"Error \"Unexpected error while invoking API {}\" thrown in apache/hadoop.","triggerScenarios":"An unclassified exception escaped while the Router was invoking an API on a namenode.","commonSituations":"Unexpected IOExceptions from the subcluster, version incompatibilities, or bugs surfaced during RPC fan-out.","solutions":["Examine the chained exception in the Router log for the underlying cause (IOException type).","If it is a transient standby/unavailable error, retry the operation.","Verify the invoked API is supported by the target subcluster's Hadoop version."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}