{"record":{"id":"36162be2a323ee84","repo":"apache/hadoop","slug":"callqueue-capacity-weights-must-specify-priority","errorCode":null,"errorMessage":"callqueue.capacity.weights must specify ${priorityLevels} capacity weights: one for each priority level","messagePattern":"callqueue\\.capacity\\.weights must specify (.+?) capacity weights: one for each priority level","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java","lineNumber":424,"sourceCode":"    }\n    if(retval < 1) {\n      throw new IllegalArgumentException(\"numLevels must be at least 1\");\n    }\n    return retval;\n  }\n\n  /**\n   * Read the weights of capacity in callqueue and pass the value to\n   * callqueue constructions.\n   */\n  private static int[] parseCapacityWeights(\n      int priorityLevels, String ns, Configuration conf) {\n    int[] weights = conf.getInts(ns + \".\" +\n      CommonConfigurationKeys.IPC_CALLQUEUE_CAPACITY_WEIGHTS_KEY);\n    if (weights.length == 0) {\n      weights = getDefaultQueueCapacityWeights(priorityLevels);\n    } else if (weights.length != priorityLevels) {\n      throw new IllegalArgumentException(\n          CommonConfigurationKeys.IPC_CALLQUEUE_CAPACITY_WEIGHTS_KEY + \" must \"\n              + \"specify \" + priorityLevels + \" capacity weights: one for each \"\n              + \"priority level\");\n    } else {\n      // only allow positive numbers\n      for (int w : weights) {\n        if (w <= 0) {\n          throw new IllegalArgumentException(\n              CommonConfigurationKeys.IPC_CALLQUEUE_CAPACITY_WEIGHTS_KEY +\n                  \" only takes positive weights. \" + w + \" capacity weight \" +\n                  \"found\");\n        }\n      }\n    }\n    return weights;\n  }\n\n  /**","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java#L406-L442","documentation":"CallQueueManager.parseCapacityWeights reads ipc.<port>.callqueue.capacity.weights (an int list). If the list is empty, equal default weights are used; if it is non-empty but its length differs from the configured scheduler priority levels, this IllegalArgumentException is thrown because each priority level needs exactly one capacity weight.","triggerScenarios":"Setting ipc.<port>.callqueue.capacity.weights to a comma-separated list whose count differs from ipc.<port>.scheduler.priority.levels — e.g., weights '4,3,2,1' while priority.levels is 5, or a single '3' while levels is the default 4.","commonSituations":"Tuning FairCallQueue capacity distribution on NameNode/ResourceManager ports; changing scheduler.priority.levels without updating the weights list; trailing commas or parsing artifacts producing a different element count than intended.","solutions":["Count your weights and make them equal ipc.<port>.scheduler.priority.levels (e.g., '10,5,3,1' for 4 levels).","Or remove callqueue.capacity.weights entirely to get equal default weights per level.","Double-check the effective priority levels value — the mismatch is often on the levels side, not the weights side.","Watch for the deprecated ipc.<port>.callqueue.priority.levels overriding your intended level count."],"exampleFix":"# before\n<property><name>ipc.8020.scheduler.priority.levels</name><value>4</value></property>\n<property><name>ipc.8020.callqueue.capacity.weights</name><value>4,3</value></property> <!-- 2 != 4 -->\n\n# after\n<property><name>ipc.8020.callqueue.capacity.weights</name><value>4,3,2,1</value></property>","handlingStrategy":"validation","validationCode":"int levels = conf.getInt(\"ipc.8020.scheduler.priority.levels\", 4);\nint[] weights = conf.getInts(\"ipc.8020.callqueue.capacity.weights\");\nif (weights != null && weights.length > 0) {\n  Preconditions.checkArgument(weights.length == levels,\n      \"need exactly %s weights, got %s\", levels, weights.length);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive the weights count from the configured priority levels in config templates.","Prefer omitting callqueue.capacity.weights unless you truly need unequal capacities.","Automated config checks (CI or Ambari/Cloudera validation) for paired ipc.* keys."],"tags":["hadoop","ipc","configuration","callqueue","validation","server-startup"],"backgroundTag":"config-array-length-mismatch","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}