apache/hadoop · critical · IllegalArgumentException
callqueue.capacity.weights only takes positive weights. ${w}
Error message
callqueue.capacity.weights only takes positive weights. ${w} capacity weight found What it means
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.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java:432
* Read the weights of capacity in callqueue and pass the value to
* callqueue constructions.
*/
private static int[] parseCapacityWeights(
int priorityLevels, String ns, Configuration conf) {
int[] weights = conf.getInts(ns + "." +
CommonConfigurationKeys.IPC_CALLQUEUE_CAPACITY_WEIGHTS_KEY);
if (weights.length == 0) {
weights = getDefaultQueueCapacityWeights(priorityLevels);
} else if (weights.length != priorityLevels) {
throw new IllegalArgumentException(
CommonConfigurationKeys.IPC_CALLQUEUE_CAPACITY_WEIGHTS_KEY + " must "
+ "specify " + priorityLevels + " capacity weights: one for each "
+ "priority level");
} else {
// only allow positive numbers
for (int w : weights) {
if (w <= 0) {
throw new IllegalArgumentException(
CommonConfigurationKeys.IPC_CALLQUEUE_CAPACITY_WEIGHTS_KEY +
" only takes positive weights. " + w + " capacity weight " +
"found");
}
}
}
return weights;
}
/**
* By default, queue capacity is the same for all priority levels.
*
* @param priorityLevels number of levels
* @return default weights
*/
public static int[] getDefaultQueueCapacityWeights(int priorityLevels) {
int[] weights = new int[priorityLevels];
Arrays.fill(weights, 1);View on GitHub (pinned to 2add963021)
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.
Example fix
# before <property><name>ipc.8020.callqueue.capacity.weights</name><value>4,3,2,0</value></property> <!-- 0 is illegal --> # after <property><name>ipc.8020.callqueue.capacity.weights</name><value>4,3,2,1</value></property>
Defensive patterns
Strategy: validation
Validate before calling
int[] weights = conf.getInts("ipc.8020.callqueue.capacity.weights");
for (int w : weights) {
Preconditions.checkArgument(w > 0, "weights must be positive, got %s", w);
} Prevention
- 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.
When it happens
Trigger: 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'.
Common situations: 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.
Related errors
- numLevels must be at least 1
- callqueue.capacity.weights must specify ${priorityLevels} ca
- ${theClass.getName()} could not be constructed.
- Illegal field separator: ${separator}
- value cannot be blank
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/8d1fdff1b3850fbe.
Report an issue: GitHub.