{"record":{"id":"9e145dd9300a37f5","repo":"aeron-io/aeron","slug":"low-session-id-value-low-must-be-high-value-high","errorCode":null,"errorMessage":"low session id value ${low} must be <= high value ${high}","messagePattern":"low session id value (.+?) must be <= high value (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/Configuration.java","lineNumber":2564,"sourceCode":"\n        if (!BitUtil.isPowerOfTwo(pageSize))\n        {\n            throw new ConfigurationException(\"filePageSize not a power of 2: \" + pageSize);\n        }\n    }\n\n    /**\n     * Validate the range of session ids based on a high and low value provided which accounts for the values wrapping.\n     *\n     * @param low  value in the range.\n     * @param high value in the range.\n     * @throws ConfigurationException if the values are not valid.\n     */\n    public static void validateSessionIdRange(final int low, final int high)\n    {\n        if (low > high)\n        {\n            throw new ConfigurationException(\"low session id value \" + low + \" must be <= high value \" + high);\n        }\n\n        if (Math.abs((long)high - low) > Integer.MAX_VALUE)\n        {\n            throw new ConfigurationException(\"reserved session range too large\");\n        }\n    }\n\n    /**\n     * Compute the length of the {@link org.agrona.concurrent.status.CountersManager} metadata buffer based on the\n     * length of the counters value buffer length.\n     *\n     * @param counterValuesBufferLength to compute the metadata buffer length from as a ratio.\n     * @return the length that should be used for the metadata buffer for counters.\n     */\n    public static int countersMetadataBufferLength(final int counterValuesBufferLength)\n    {\n        return counterValuesBufferLength * (CountersReader.METADATA_LENGTH / CountersReader.COUNTER_LENGTH);","sourceCodeStart":2546,"sourceCodeEnd":2582,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/Configuration.java#L2546-L2582","documentation":"Configuration.validateSessionIdRange validates the low/high bounds of the reserved session-id range used when the driver assigns session ids. It throws this ConfigurationException if the low bound is greater than the high bound, since the range would be empty/inverted. This prevents downstream session id generation from behaving nonsensically.","triggerScenarios":"Calling Configuration.validateSessionIdRange(low, high) with low > high, e.g. configuring aeron.session.id.range.low=500 and aeron.session.id.range.high=100.","commonSituations":"Swapping the low/high properties by mistake; constructing the range programmatically from min/max where the inputs arrive sorted incorrectly; copy-paste errors in driver configuration files.","solutions":["Swap the values so low <= high in the configuration (aeron.session.id.range.low / aeron.session.id.range.high)","If computed programmatically, sort with Math.min/max before validating","Review the config source for swapped variable names"],"exampleFix":"// before\nctx.sessionIdRange(500, 100);\n// after\nctx.sessionIdRange(100, 500); // low <= high","handlingStrategy":"validation","validationCode":"int low = Integer.getInteger(\"aeron.session.id.range.low\", 0);\nint high = Integer.getInteger(\"aeron.session.id.range.high\", Integer.MAX_VALUE);\nif (low > high) { int t = low; low = high; high = t; }\nio.aeron.driver.Configuration.validateSessionIdRange(low, high);","typeGuard":null,"tryCatchPattern":"try {\n    Configuration.validateSessionIdRange(low, high);\n} catch (ConfigurationException e) {\n    Configuration.validateSessionIdRange(Math.min(low, high), Math.max(low, high));\n}","preventionTips":["Normalize ranges with Math.min/Math.max before configuring","Name config keys unambiguously to avoid swapping low/high","Validate all driver properties in a startup self-check"],"tags":["aeron","configuration","session-id","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}