{"record":{"id":"93f2db12a14aa90f","repo":"aeron-io/aeron","slug":"exceeded-session-limit-streamid-streamid-sourceaddress","errorCode":null,"errorMessage":"exceeded session limit, streamId=${streamId} sourceAddress=${srcAddress}","messagePattern":"exceeded session limit, streamId=(.+?) sourceAddress=(.+?)","errorType":"exception","errorClass":"AeronEvent","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/DataPacketDispatcher.java","lineNumber":344,"sourceCode":"     * @param srcAddress      the message came from.\n     * @param transportIndex  on which the message was received.\n     */\n    public void onSetupMessage(\n        final ReceiveChannelEndpoint channelEndpoint,\n        final SetupFlyweight msg,\n        final InetSocketAddress srcAddress,\n        final int transportIndex)\n    {\n        final int streamId = msg.streamId();\n        final StreamInterest streamInterest = streamInterestByIdMap.get(streamId);\n\n        if (null != streamInterest)\n        {\n            final int sessionId = msg.sessionId();\n\n            if (streamInterest.isSessionLimitExceeded(streamSessionLimit))\n            {\n                throw new AeronEvent(\"exceeded session limit, streamId=\" + streamId + \" sourceAddress=\" + srcAddress);\n            }\n\n            final PublicationImage image = streamInterest.findActive(sessionId);\n            final SessionState sessionInterest = streamInterest.sessionInterestByIdMap.get(sessionId);\n\n            if (null != image)\n            {\n                image.addDestinationConnectionIfUnknown(transportIndex, srcAddress);\n            }\n            else if (null != sessionInterest)\n            {\n                if (PENDING_SETUP_FRAME == sessionInterest)\n                {\n                    streamInterest.sessionInterestByIdMap.put(sessionId, INIT_IN_PROGRESS);\n\n                    createPublicationImage(\n                        channelEndpoint,\n                        transportIndex,","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/DataPacketDispatcher.java#L326-L362","documentation":"DataPacketDispatcher.onSetupMessage throws AeronEvent when a stream's session limit (streamSessionLimit) is exceeded: a SETUP packet arrived for a new session on a stream that already tracks the maximum number of active sessions, so the driver refuses to create interest for another session.","triggerScenarios":"Receiving a SETUP frame on a stream where isSessionLimitLimit(streamSessionLimit) is true — i.e. more distinct sender sessionIds than the configured session limit are trying to publish to the same stream/channel the subscription listens on.","commonSituations":"Many publishers (or duplicate/looping publishers, misconfigured senders reusing endpoints) connecting to a single subscription; attacks or accidental multicast fan-in; too-low aeron.driver.session-limit style configuration.","solutions":["Raise the driver's session limit configuration so the subscription can accept more concurrent sessions","Identify and stop stray publishers sending to the same channel/stream (duplicate processes, leftover instances)","Filter senders with network/firewall rules so only intended sources publish"],"exampleFix":"// before\nmediaDriver = MediaDriver.launch(new MediaDriver.Context() /* default session limit */);\n// after\nctx.sessionLimit(64); // allow more concurrent sessions per stream\nmediaDriver = MediaDriver.launch(ctx);","handlingStrategy":"try-catch","validationCode":"int activeSessions = countActiveSessions(streamId); if (activeSessions >= sessionLimit) { /* refuse or alert before senders hit the limit */ }","typeGuard":null,"tryCatchPattern":"try { dispatcher.onSetupMessage(...); } catch (AeronEvent e) { log.warn(\"session limit reached: \" + e.getMessage()); }","preventionTips":["Size the session limit for the expected publisher count","Monitor for unknown publishers on the same channel/stream","Restrict senders via network policy"],"tags":["network","udp","session-limit","aeron-driver"],"backgroundTag":"rate-limit-exceeded","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}