apache/cassandra · error · IllegalArgumentException

Invalid limit in queue_active_limits

Error message

Invalid limit ${value} in queue_active_limits: ${input}

What it means

When parsing a 'queue:limit' specifier, AccordExecutor requires the limit to be a long strictly between 0 and 128 (exclusive), because limits are packed one-per-byte into a bitmask. Limits of 0, negative, or >= 128 throw IllegalArgumentException with this message.

Solutions

  1. Set limits in the range 1..127 for each queue specifier.
  2. Remove a queue specifier entirely instead of using 0 to disable it.
  3. Verify the value parses as a plain decimal long with no units (no 'k', '%', etc.).

Example fix

// before
-Dcassandra.acord.queue_active_limits=load:0;local:130
// after
-Dcassandra.acord.queue_active_limits=load:1;local:127
Defensive patterns

Strategy: validation

Validate before calling

long limit = Long.parseLong(spec.split(":")[1]);
if (limit <= 0 || limit >= 128) throw new IllegalArgumentException("limit must be 1..127: " + limit);

Prevention

When it happens

Trigger: Specifying 'load:0', 'load:-1', 'load:128', or 'load:200' in the queue_active_limits-style property consumed by AccordExecutor.parseEnumParams.

Common situations: Attempting to disable a queue with 0 (use omission instead); mixing up bit-width constraints; pasting a percentage or count over 127.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/e34a47a94298dc85. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/service/accord/execution/AccordExecutor.java:836

    }

    private static long parseEnumParams(Function<String, ? extends Enum<?>> get, String input, String describe)
    {
        long result = 0;
        for (String spec : input.split(","))
        {
            if (spec.trim().isEmpty()) continue;

            String[] split = spec.split(":");
            if (split.length != 2)
                throw new IllegalArgumentException("Invalid specifier " + spec + " in " + describe + ": " + input);

            try
            {
                Enum<?> queue = get.apply(split[0]);
                long value = Long.parseLong(split[1]);
                if (value <= 0 || value >= 128)
                    throw new IllegalArgumentException("Invalid limit " + value + " in queue_active_limits: " + input);

                result |= value << (queue.ordinal() * 8);
            }
            catch (Throwable t)
            {
                throw new IllegalArgumentException("Invalid queue identifier " + split[0] + " in " + describe + ": " + input);
            }
        }

        return result;
    }
}

View on GitHub (pinned to 88fd0f6a0e)