kafka runtime_error ai_generated true

org.apache.kafka.common.errors.GroupJoinTimeoutException: Join group request timed out

ID: kafka/group-join-timeout

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
1Evidence
2024-03-15First Seen

Root Cause

Consumer failed to join the consumer group within the configured session timeout or max.poll.interval.ms.

generic

中文

消费者未能在配置的会话超时或max.poll.interval.ms内加入消费者组。

Official Documentation

https://kafka.apache.org/documentation/#consumerconfigs_session.timeout.ms

Workarounds

  1. 80% success Increase max.poll.interval.ms to allow more time between polls, e.g., props.put("max.poll.interval.ms", "600000");
    Increase max.poll.interval.ms to allow more time between polls, e.g., props.put("max.poll.interval.ms", "600000");
  2. 75% success Reduce max.poll.records to process fewer records per poll, e.g., props.put("max.poll.records", "100");
    Reduce max.poll.records to process fewer records per poll, e.g., props.put("max.poll.records", "100");
  3. 85% success Use a separate thread for processing and call consumer.commitAsync() more frequently.
    Use a separate thread for processing and call consumer.commitAsync() more frequently.

中文步骤

  1. 增加 max.poll.interval.ms 以允许轮询之间有更多时间,例如 props.put("max.poll.interval.ms", "600000");
  2. 减少 max.poll.records 以每次轮询处理更少的记录,例如 props.put("max.poll.records", "100");
  3. 使用单独的线程进行处理并更频繁地调用 consumer.commitAsync()。

Dead Ends

Common approaches that don't work:

  1. 85% fail

    Increasing session.timeout.ms alone doesn't fix slow processing; it only delays the timeout.

  2. 90% fail

    Restarting the consumer doesn't resolve the underlying cause of slow processing or network issues.