apache/cassandra · error · IllegalArgumentException

stream_throughput_outbound: is too large; it should be less

Error message

stream_throughput_outbound: is too large; it should be less than 2147483647 in megabits/s

What it means

setStreamThroughputOutboundMebibytesPerSecAsInt converts MiB/s to megabits/s and rejects values whose conversion reaches Integer.MAX_VALUE megabits/s, because the underlying DataRateSpec bound is capped at the int-representable megabits/s range.

Source

Thrown at src/java/org/apache/cassandra/config/DatabaseDescriptor.java:3176

    public static double getStreamThroughputOutboundMebibytesPerSec()
    {
        return conf.stream_throughput_outbound.toMebibytesPerSecond();
    }

    public static double getStreamThroughputOutboundBytesPerSec()
    {
        return conf.stream_throughput_outbound.toBytesPerSecond();
    }

    public static int getStreamThroughputOutboundMebibytesPerSecAsInt()
    {
        return conf.stream_throughput_outbound.toMebibytesPerSecondAsInt();
    }

    public static void setStreamThroughputOutboundMebibytesPerSecAsInt(int value)
    {
        if (MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >= Integer.MAX_VALUE)
            throw new IllegalArgumentException("stream_throughput_outbound: " + value +
                                               " is too large; it should be less than " +
                                               Integer.MAX_VALUE + " in megabits/s");

        conf.stream_throughput_outbound = new DataRateSpec.LongBytesPerSecondBound(value, MEBIBYTES_PER_SECOND);
    }

    public static void setStreamThroughputOutboundBytesPerSec(long value)
    {
        conf.stream_throughput_outbound = new DataRateSpec.LongBytesPerSecondBound(value, BYTES_PER_SECOND);
    }

    public static void setStreamThroughputOutboundMegabitsPerSec(int value)
    {
        conf.stream_throughput_outbound = DataRateSpec.LongBytesPerSecondBound.megabitsPerSecondInBytesPerSecond(value);
    }

    public static double getEntireSSTableStreamThroughputOutboundMebibytesPerSec()
    {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Pass a realistic MiB/s value well below the cap (any practical streaming rate qualifies).
  2. Validate the converted megabits/s figure before calling.
  3. Avoid Integer.MAX_VALUE/MIN_VALUE sentinels entirely.

Example fix

// before
DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(Integer.MAX_VALUE);
// after
DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(200); // 200 MiB/s
Defensive patterns

Strategy: validation

Validate before calling

long mbits = DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND.toMegabitsPerSecond(mibPerSec);
if (mbits < Integer.MAX_VALUE) DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(mibPerSec);

Type guard

boolean isValidStreamMibPerSec(int v) { return v >= 0 && DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND.toMegabitsPerSecond(v) < Integer.MAX_VALUE; }

Try / catch

try { DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(v); } catch (IllegalArgumentException e) { log.error("stream_throughput_outbound too large: {}", v, e); }

Prevention

When it happens

Trigger: Calling DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(value) where MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >= 2147483647 (values above ~2.1e9 MiB/s, including Integer.MIN_VALUE overflow).

Common situations: Sentinel values like Integer.MAX_VALUE passed as 'unlimited'; scripted/JMX tuning with unvalidated ints; unit confusion between megabits and mebibytes.

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/5cdb43e5b37fbfcd. Report an issue: GitHub.