{"record":{"id":"8d1fdff1b3850fbe","repo":"apache/hadoop","slug":"callqueue-capacity-weights-only-takes-positive-wei","errorCode":null,"errorMessage":"callqueue.capacity.weights only takes positive weights. ${w} capacity weight found","messagePattern":"callqueue\\.capacity\\.weights only takes positive weights\\. (.+?) capacity weight found","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java","lineNumber":432,"sourceCode":"   * 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  /**\n   * By default, queue capacity is the same for all priority levels.\n   *\n   * @param priorityLevels number of levels\n   * @return default weights\n   */\n  public static int[] getDefaultQueueCapacityWeights(int priorityLevels) {\n    int[] weights = new int[priorityLevels];\n    Arrays.fill(weights, 1);","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java#L414-L450","documentation":"After parseCapacityWeights confirms the count matches the priority levels, it validates each element of ipc.<port>.callqueue.capacity.weights. Any weight <= 0 throws this IllegalArgumentException, because a zero or negative subqueue capacity would make that priority level unusable.","triggerScenarios":"Including 0 (to 'switch off' a level) or a negative number in ipc.<port>.callqueue.capacity.weights; using '-' separators or malformed values that Configuration.getInts parses as negative; hand-edited XML with a stray '-1'.","commonSituations":"Attempting to disable a FairCallQueue tier by weighting it 0; copy-paste arithmetic in config templates producing negative deltas; operators assuming 0-weight is a legal way to drop a queue level.","solutions":["Use only positive integers, e.g., '4,3,2,1' — weight a rarely used level with 1 instead of 0.","To effectively reduce levels, lower ipc.<port>.scheduler.priority.levels and provide that many positive weights.","Lint the property programmatically before server start (see validation snippet).","Restart the RPC server after correcting core-site.xml."],"exampleFix":"# before\n<property><name>ipc.8020.callqueue.capacity.weights</name><value>4,3,2,0</value></property> <!-- 0 is illegal -->\n\n# after\n<property><name>ipc.8020.callqueue.capacity.weights</name><value>4,3,2,1</value></property>","handlingStrategy":"validation","validationCode":"int[] weights = conf.getInts(\"ipc.8020.callqueue.capacity.weights\");\nfor (int w : weights) {\n  Preconditions.checkArgument(w > 0, \"weights must be positive, got %s\", w);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never use 0 to disable a level; reduce scheduler.priority.levels instead.","Use weight 1 as the minimum for rarely used tiers.","Lint ipc.<port>.callqueue.capacity.weights in deployment pipelines."],"tags":["hadoop","ipc","configuration","callqueue","validation","server-startup"],"backgroundTag":"invalid-configuration-value","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}