{"record":{"id":"86a4374949fa2ec0","repo":"apache/hadoop","slug":"trigger-bos-rate-limit-for-too-many-requests","errorCode":null,"errorMessage":"trigger bos rate limit for too many requests !!!","messagePattern":"trigger bos rate limit for too many requests !!!","errorType":"exception","errorClass":"BandwidthLimitException","httpStatus":429,"severity":"error","filePath":"hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BosClientProxyImpl.java","lineNumber":526,"sourceCode":"    if (400 == e.getStatusCode()\n        && (e.getErrorCode() == null\n            || \"null\".equals(e.getErrorCode())\n            || \"InvalidSessionToken\".equals(\n                e.getErrorCode().trim()))) {\n      LOG.error(\n          \"sts session expired or invalid,\"\n              + \" need to update client\");\n      throw new SessionTokenExpireException(e);\n    } else if (400 == e.getStatusCode()) {\n      LOG.error(\"request unknown error : {}\",\n          e.getCause());\n      throw new SessionTokenExpireException(e);\n    } else if (BOS_REQUEST_LIMIT_CODE\n        == e.getStatusCode()\n        && (e.getErrorCode() == null\n            || e.getErrorCode().trim()\n                .equals(\"null\"))) {\n      throw new BandwidthLimitException(\n          new IOException(\n              \"trigger bos rate limit\"\n                  + \" for too many requests !!!\"));\n    } else if (BOS_REQUEST_LIMIT_CODE\n        == e.getStatusCode()\n        && e.getErrorCode().trim()\n            .equals(\"RequestRateLimitExceeded\")) {\n      throw new BosHotObjectException(\n          new IOException(\n              \"trigger bos object rate limit !!!\"));\n    } else if (BOS_REQUEST_LIMIT_CODE\n        == e.getStatusCode()) {\n      throw new BosHotObjectException(\n          new IOException(\n              \"status code 429 !!!\" + e.getCause()));\n    } else if (e.getCause() instanceof IOException) {\n      throw (IOException) e.getCause();\n    } else {","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BosClientProxyImpl.java#L508-L544","documentation":"ZombieJob.getTaskInfo(loggedTask) computes aggregate TaskInfo (input/output bytes and records, resource metrics) from a task's successful attempts, but first requires the task type to be exactly MAP or REDUCE — otherwise it throws IllegalArgumentException('getTaskInfo only supports MAP or REDUCE tasks: <type> for task = <id>'). getTaskInfo() is called from many ZombieJob paths (missing attempts, killed attempts, locality scaling), so a non-MAP/REDUCE task record anywhere in a replayed trace can surface this error from several call sites.","triggerScenarios":"A LoggedTask with taskType SETUP/CLEANUP/null reaching getTaskInfo() — via getMapTaskAttemptInfoAdjusted() when the task exists but an attempt is missing or killed, or via custom JobStory code calling getTaskInfo directly; damaged traces with null taskType.","commonSituations":"Simulating traces that contain job setup/cleanup tasks; custom simulator harnesses that walk all tasks of a LoggedJob; traces from Hadoop versions that record additional task kinds (e.g. ACTION) unknown to this rumen build.","solutions":["Filter tasks to MAP/REDUCE before replay: when iterating LoggedJob tasks, skip any whose getTaskType() is neither Values.MAP nor Values.REDUCE.","Regenerate or repair the trace so only map/reduce tasks carry simulation-relevant attempts.","Wrap ZombieJob in a defensive JobStory that returns a zero TaskInfo (new TaskInfo(0,0,0,0,0,0), the same default ZombieJob uses for null tasks) for non-MAP/REDUCE tasks instead of propagating the exception."],"exampleFix":"// before\nTaskInfo info = zombieJob.getTaskInfo(anyLoggedTask); // throws for SETUP\n\n// after\nif (anyLoggedTask.getTaskType() == Values.MAP\n    || anyLoggedTask.getTaskType() == Values.REDUCE) {\n  info = zombieJob.getTaskInfo(anyLoggedTask);\n} else {\n  info = new TaskInfo(0, 0, 0, 0, 0, 0); // neutral default for setup/cleanup\n}","handlingStrategy":"type-guard","validationCode":"static boolean supportsTaskInfo(LoggedTask t) {\n  Values type = (t == null) ? null : t.getTaskType();\n  return type == Values.MAP || type == Values.REDUCE;\n}","typeGuard":"static boolean isMapOrReduce(LoggedTask t) {\n  Values v = (t == null) ? null : t.getTaskType();\n  return v == Values.MAP || v == Values.REDUCE;\n}","tryCatchPattern":null,"preventionTips":["Gate every getTaskInfo() call on getTaskType() being MAP or REDUCE.","Return the zero TaskInfo(0,0,0,0,0,0) default for non-simulatable tasks in wrapper JobStories.","Filter setup/cleanup tasks during trace loading so they never reach simulation paths."],"tags":["hadoop","rumen","unsupported-task-type","job-trace","task-info"],"backgroundTag":"unsupported-task-type","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}