kafka network_error ai_generated partial

org.apache.kafka.common.errors.TimeoutException: Offset commit request timed out after 60000 ms

ID: kafka/offset-commit-future-timeout

Also available as: JSON · Markdown · 中文
82%Fix Rate
83%Confidence
1Evidence
2024-01-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.2.0 active
3.4.0 active
3.6.1 active

Root Cause

The consumer's offset commit request to the group coordinator timed out due to network latency, coordinator unavailability, or overload.

generic

中文

消费者向组协调器提交偏移量的请求因网络延迟、协调器不可用或过载而超时。

Official Documentation

https://kafka.apache.org/documentation/#consumerconfigs_default.api.timeout.ms

Workarounds

  1. 85% success Increase the consumer's default.api.timeout.ms to allow more time for offset commits: props.put(ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG, 120000); Also ensure network connectivity to the group coordinator is stable.
    Increase the consumer's default.api.timeout.ms to allow more time for offset commits:
    props.put(ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG, 120000);
    Also ensure network connectivity to the group coordinator is stable.
  2. 80% success Identify the group coordinator and check its health: kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --describe If the coordinator is overloaded, scale out the broker cluster or reduce the number of consumer groups.
    Identify the group coordinator and check its health:
    kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --describe
    If the coordinator is overloaded, scale out the broker cluster or reduce the number of consumer groups.

中文步骤

  1. Increase the consumer's default.api.timeout.ms to allow more time for offset commits:
    props.put(ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG, 120000);
    Also ensure network connectivity to the group coordinator is stable.
  2. Identify the group coordinator and check its health:
    kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --describe
    If the coordinator is overloaded, scale out the broker cluster or reduce the number of consumer groups.

Dead Ends

Common approaches that don't work:

  1. 75% fail

    Enabling auto.offset.commit=false prevents automatic commits but does not fix the underlying network issue.

  2. 85% fail

    Increasing session.timeout.ms only affects liveness detection, not commit request timeouts.