{"record":{"id":"5cdb43e5b37fbfcd","repo":"apache/cassandra","slug":"stream-throughput-outbound-is-too-large-it-shoul","errorCode":null,"errorMessage":"stream_throughput_outbound: is too large; it should be less than 2147483647 in megabits/s","messagePattern":"stream_throughput_outbound: is too large; it should be less than 2147483647 in megabits/s","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/config/DatabaseDescriptor.java","lineNumber":3176,"sourceCode":"    public static double getStreamThroughputOutboundMebibytesPerSec()\n    {\n        return conf.stream_throughput_outbound.toMebibytesPerSecond();\n    }\n\n    public static double getStreamThroughputOutboundBytesPerSec()\n    {\n        return conf.stream_throughput_outbound.toBytesPerSecond();\n    }\n\n    public static int getStreamThroughputOutboundMebibytesPerSecAsInt()\n    {\n        return conf.stream_throughput_outbound.toMebibytesPerSecondAsInt();\n    }\n\n    public static void setStreamThroughputOutboundMebibytesPerSecAsInt(int value)\n    {\n        if (MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >= Integer.MAX_VALUE)\n            throw new IllegalArgumentException(\"stream_throughput_outbound: \" + value +\n                                               \" is too large; it should be less than \" +\n                                               Integer.MAX_VALUE + \" in megabits/s\");\n\n        conf.stream_throughput_outbound = new DataRateSpec.LongBytesPerSecondBound(value, MEBIBYTES_PER_SECOND);\n    }\n\n    public static void setStreamThroughputOutboundBytesPerSec(long value)\n    {\n        conf.stream_throughput_outbound = new DataRateSpec.LongBytesPerSecondBound(value, BYTES_PER_SECOND);\n    }\n\n    public static void setStreamThroughputOutboundMegabitsPerSec(int value)\n    {\n        conf.stream_throughput_outbound = DataRateSpec.LongBytesPerSecondBound.megabitsPerSecondInBytesPerSecond(value);\n    }\n\n    public static double getEntireSSTableStreamThroughputOutboundMebibytesPerSec()\n    {","sourceCodeStart":3158,"sourceCodeEnd":3194,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L3158-L3194","documentation":"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.","triggerScenarios":"Calling DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(value) where MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >= 2147483647 (values above ~2.1e9 MiB/s, including Integer.MIN_VALUE overflow).","commonSituations":"Sentinel values like Integer.MAX_VALUE passed as 'unlimited'; scripted/JMX tuning with unvalidated ints; unit confusion between megabits and mebibytes.","solutions":["Pass a realistic MiB/s value well below the cap (any practical streaming rate qualifies).","Validate the converted megabits/s figure before calling.","Avoid Integer.MAX_VALUE/MIN_VALUE sentinels entirely."],"exampleFix":"// before\nDatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(Integer.MAX_VALUE);\n// after\nDatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(200); // 200 MiB/s","handlingStrategy":"validation","validationCode":"long mbits = DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND.toMegabitsPerSecond(mibPerSec);\nif (mbits < Integer.MAX_VALUE) DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(mibPerSec);","typeGuard":"boolean isValidStreamMibPerSec(int v) { return v >= 0 && DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND.toMegabitsPerSecond(v) < Integer.MAX_VALUE; }","tryCatchPattern":"try { DatabaseDescriptor.setStreamThroughputOutboundMebibytesPerSecAsInt(v); } catch (IllegalArgumentException e) { log.error(\"stream_throughput_outbound too large: {}\", v, e); }","preventionTips":["Avoid Integer.MAX_VALUE/MIN_VALUE sentinels","Account for the MiB/s -> megabits/s conversion (x8.39) when picking limits","Validate scripted/JMX inputs before applying runtime config"],"tags":["configuration","streaming","throughput"],"backgroundTag":"value-out-of-range","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}