aeron-io/aeron · error · AeronEvent
exceeded session limit, streamId=
Error message
exceeded session limit, streamId=${streamId} sourceAddress=${srcAddress} What it means
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.
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
Example fix
// before mediaDriver = MediaDriver.launch(new MediaDriver.Context() /* default session limit */); // after ctx.sessionLimit(64); // allow more concurrent sessions per stream mediaDriver = MediaDriver.launch(ctx);
Defensive patterns
Strategy: try-catch
Validate before calling
int activeSessions = countActiveSessions(streamId); if (activeSessions >= sessionLimit) { /* refuse or alert before senders hit the limit */ } Try / catch
try { dispatcher.onSetupMessage(...); } catch (AeronEvent e) { log.warn("session limit reached: " + e.getMessage()); } Prevention
- Size the session limit for the expected publisher count
- Monitor for unknown publishers on the same channel/stream
- Restrict senders via network policy
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- channel error -
- could not resolve control address:
- could not resolve endpoint address:
- failed get replay image for sessionId=" +…
- mtuLength= > MAX_UDP_PAYLOAD_LENGTH=
AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12).
Data as JSON: /api/errors/93f2db12a14aa90f.
Report an issue: GitHub.
Appendix: source
Thrown at aeron-driver/src/main/java/io/aeron/driver/DataPacketDispatcher.java:344
* @param srcAddress the message came from.
* @param transportIndex on which the message was received.
*/
public void onSetupMessage(
final ReceiveChannelEndpoint channelEndpoint,
final SetupFlyweight msg,
final InetSocketAddress srcAddress,
final int transportIndex)
{
final int streamId = msg.streamId();
final StreamInterest streamInterest = streamInterestByIdMap.get(streamId);
if (null != streamInterest)
{
final int sessionId = msg.sessionId();
if (streamInterest.isSessionLimitExceeded(streamSessionLimit))
{
throw new AeronEvent("exceeded session limit, streamId=" + streamId + " sourceAddress=" + srcAddress);
}
final PublicationImage image = streamInterest.findActive(sessionId);
final SessionState sessionInterest = streamInterest.sessionInterestByIdMap.get(sessionId);
if (null != image)
{
image.addDestinationConnectionIfUnknown(transportIndex, srcAddress);
}
else if (null != sessionInterest)
{
if (PENDING_SETUP_FRAME == sessionInterest)
{
streamInterest.sessionInterestByIdMap.put(sessionId, INIT_IN_PROGRESS);
createPublicationImage(
channelEndpoint,
transportIndex,View on GitHub (pinned to 6d60124e15)