Kafka Error SHARE_SESSION_LIMIT_REACHED
Error code 133 · Retriable Share Groups
The limit of share sessions has been reached.
Common Causes
- The broker has reached its maximum configured number of concurrent share sessions (`group.share.max.share.sessions`), preventing new share fetch sessions from being established
- Share session leak: consumers are creating new sessions without properly closing old ones (not sending `ShareFetch` with epoch=-1 on shutdown), exhausting the session pool over time.
- Traffic spike or consumer scale-out event rapidly opened many new share sessions simultaneously before old sessions could be garbage-collected by the broker.
Solutions
- The error is retriable — back off and retry session creation. Kafka share group clients automatically retry. Implement exponential backoff in custom consumers to avoid thundering herd during session limit events.
- Increase the broker's maximum share sessions limit if the current value is too low for your consumer fleet size by tuning `group.share.max.share.sessions`
- Ensure all share group consumers properly close sessions on shutdown by sending a final `ShareFetch` with `shareSessionEpoch=-1`. Add JVM shutdown hooks to guarantee graceful session closure even during SIGTERM.
Diagnostic Commands
# List all share groups
kafka-share-groups.sh --bootstrap-server localhost:9092 --list
# Look for share session events in logs
grep 'SHARE_SESSION_LIMIT_REACHED\|share session limit\|ShareFetch' /var/log/kafka/server.log | tail -50Related APIs
This error can be returned by: ShareFetch
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.