apache/cassandra · error · IllegalArgumentException

inter_dc_stream_throughput_outbound: is too large; it should

Error message

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

What it means

setInterDCStreamThroughputOutboundMebibytesPerSecAsInt converts MiB/s to megabits/s and rejects values converting to >= Integer.MAX_VALUE megabits/s, since the DataRateSpec outbound inter-DC bound is limited to the int-representable megabits/s range.

Source

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

    public static double getInterDCStreamThroughputOutboundMebibytesPerSec()
    {
        return conf.inter_dc_stream_throughput_outbound.toMebibytesPerSecond();
    }

    public static double getInterDCStreamThroughputOutboundBytesPerSec()
    {
        return conf.inter_dc_stream_throughput_outbound.toBytesPerSecond();
    }

    public static int getInterDCStreamThroughputOutboundMebibytesPerSecAsInt()
    {
        return conf.inter_dc_stream_throughput_outbound.toMebibytesPerSecondAsInt();
    }

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

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

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

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

    public static double getEntireSSTableInterDCStreamThroughputOutboundBytesPerSec()
    {

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Pass a realistic inter-DC streaming rate in MiB/s below the cap.
  2. Validate the converted megabits/s value before calling.
  3. Clamp or reject sentinel values (Integer.MAX_VALUE/MIN_VALUE) at the call site.

Example fix

// before
DatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(Integer.MAX_VALUE);
// after
DatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(100);
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

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

Try / catch

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

Prevention

When it happens

Trigger: Calling DatabaseDescriptor.setInterDCStreamThroughputOutboundMebibytesPerSecAsInt(value) where MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >= 2147483647 (huge values or Integer.MIN_VALUE overflow).

Common situations: Max-int sentinels as 'unlimited' inter-DC throttling; unvalidated JMX/script input; unit confusion megabits vs 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/8f0336a9e0d95ee3. Report an issue: GitHub.