kafka.errors.CommitFailedError: CommitFailedError: Commit cannot be completed since the group has already
rebalanced and assigned the partitions to another member.
This means that the time between subsequent calls to poll()
was longer than the configured max_poll_interval_ms, which
typically implies that the poll loop is spending too much
time message processing. You can address this either by
increasing the rebalance timeout with max_poll_interval_ms,
or by reducing the maximum size of batches returned in poll()
with max_poll_records.
在配置文件里设置了max_poll_interval_ms:3600000,1个小时,但实际处理的时候,还是显示超时

实际用的时间还没有1分钟。
修改配置,解决问题
'max_poll_interval_ms': 60 * 60 * 1000, # 处理逻辑最大时间,一旦Consumer处理不过来,就会被踢出Consumer Group
'request_timeout_ms': 40 * 60*1000, # 表示消费者再重新发送请求或达到最大重试次数之前等待相应请求的最大时间
'connections_max_idle_ms': 50 * 60*1000, # 心跳会话超时间隔
'session_timeout_ms': 30 * 60*1000,

博客讨论了在使用Kafka消费者时遇到的CommitFailedError问题,由于处理时间超过max_poll_interval_ms设置的1小时导致消费者组重新平衡。尽管已尝试将该参数设置为3600000毫秒,但在实际操作中仍出现超时错误。解决方案包括增加rebalance超时时间,减少poll()返回的批次大小,以及调整其他相关配置如request_timeout_ms和session_timeout_ms。这有助于确保消费者能够有效地处理消息并避免被踢出消费组。
1014

被折叠的 条评论
为什么被折叠?



