{"record":{"id":"c46256d8ccc3fe86","repo":"apache/hadoop","slug":"invalid-blacklistdisablepercent-should-be-an","errorCode":null,"errorMessage":"Invalid blacklistDisablePercent: {}. Should be an integer between 0 and 100 or -1 to disabled","messagePattern":"Invalid blacklistDisablePercent: (.+?)\\. Should be an integer between 0 and 100 or -1 to disabled","errorType":"validation","errorClass":"YarnRuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerRequestor.java","lineNumber":190,"sourceCode":"      return sb.toString();\n    }\n  }\n\n  @Override\n  protected void serviceInit(Configuration conf) throws Exception {\n    super.serviceInit(conf);\n    nodeBlacklistingEnabled = \n      conf.getBoolean(MRJobConfig.MR_AM_JOB_NODE_BLACKLISTING_ENABLE, true);\n    LOG.info(\"nodeBlacklistingEnabled:\" + nodeBlacklistingEnabled);\n    maxTaskFailuresPerNode = \n      conf.getInt(MRJobConfig.MAX_TASK_FAILURES_PER_TRACKER, 3);\n    blacklistDisablePercent =\n        conf.getInt(\n            MRJobConfig.MR_AM_IGNORE_BLACKLISTING_BLACKLISTED_NODE_PERECENT,\n            MRJobConfig.DEFAULT_MR_AM_IGNORE_BLACKLISTING_BLACKLISTED_NODE_PERCENT);\n    LOG.info(\"maxTaskFailuresPerNode is \" + maxTaskFailuresPerNode);\n    if (blacklistDisablePercent < -1 || blacklistDisablePercent > 100) {\n      throw new YarnRuntimeException(\"Invalid blacklistDisablePercent: \"\n          + blacklistDisablePercent\n          + \". Should be an integer between 0 and 100 or -1 to disabled\");\n    }\n    LOG.info(\"blacklistDisablePercent is \" + blacklistDisablePercent);\n  }\n\n  protected AllocateResponse makeRemoteRequest() throws YarnException,\n      IOException {\n    applyRequestLimits();\n    ResourceBlacklistRequest blacklistRequest =\n        ResourceBlacklistRequest.newInstance(new ArrayList<String>(blacklistAdditions),\n            new ArrayList<String>(blacklistRemovals));\n    AllocateRequest allocateRequest =\n        AllocateRequest.newInstance(lastResponseID,\n          super.getApplicationProgress(), new ArrayList<ResourceRequest>(ask),\n          new ArrayList<ContainerId>(release), blacklistRequest);\n    AllocateResponse allocateResponse = scheduler.allocate(allocateRequest);\n    lastResponseID = allocateResponse.getResponseId();","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerRequestor.java#L172-L208","documentation":"RMContainerRequestor.serviceInit validates yarn.app.mapreduce.am.job.node-blacklisting.ignore-threshold-node-percent (default 33) and throws YarnRuntimeException when the value is outside [-1, 100]. -1 disables the threshold, 0..100 sets the percentage of blacklisted nodes at which blacklisting is ignored; anything else is meaningless and fails AM initialization immediately.","triggerScenarios":"Job/cluster config sets the percent key to e.g. 150 or -2; a conf.set call with a computed value that can go negative; typo like '33%' (NumberFormatException surfaces earlier) or an off-by-one in generated configs.","commonSituations":"Tuning node-blacklisting behavior from templates that mix up 'percent' and 'count'; automation writing 0-1 fractions (0.33) or >100 values; overriding MR_AM_IGNORE_BLACKLISTING_BLACKLISTED_NODE_PERECENT per job without bounds checking.","solutions":["Set the property to -1, 0, or a value in [0,100] — e.g. 33 (default) or -1 to disable the ignore threshold","If generated programmatically, clamp the computed integer before conf.set","Check the AM launch log: the exception text echoes the offending value read from config"],"exampleFix":"<!-- before -->\n<property><name>yarn.app.mapreduce.am.job.node-blacklisting.ignore-threshold-node-percent</name><value>150</value></property>\n\n<!-- after -->\n<property><name>yarn.app.mapreduce.am.job.node-blacklisting.ignore-threshold-node-percent</name><value>33</value></property>","handlingStrategy":"validation","validationCode":"// clamp/validate before the AM ever sees it\nint pct = conf.getInt(\n    \"yarn.app.mapreduce.am.job.node-blacklisting.ignore-threshold-node-percent\", 33);\nif (pct < -1 || pct > 100) {\n  throw new IllegalArgumentException(\"blacklistDisablePercent must be -1 or 0..100, got \" + pct);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat this property as an integer percent (or -1), never a fraction or a node count","Add config linting for AM-tuning keys in CI for generated job configs"],"tags":["mapreduce","configuration","blacklisting","validation","am-init"],"backgroundTag":"config-value-out-of-range","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}