kafka CommitFailedError

本文针对线上Kafka出现的Autooffsetcommit失败问题进行了详细的解析,指出可能的原因是消息处理时间超过了max_poll_interval_ms配置,提供了调整max_poll_interval_ms的具体解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

线上kafka出现如下异常

2018-09-16 23:59:58,712-pid:20908-MainThread-consumer.py[line:782]-WARNING:Auto offset commit failed for group robot: 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,出现如上原因可能是消息的处理时间超过max_poll_interval_ms时间间隔,导致kafka认为该消费者挂掉,重新进行reblancing。

修改后max_poll_interval_ms>消息处理的时间即可

max.poll.interval.ms ,它表示最大的poll数据间隔,如果超过这个间隔没有发起pool请求,但heartbeat仍旧在发,就认为该consumer处于 livelock状态,进行reblancing

session.timeout.ms 消费者超时时间,如果消费者再超过了这个时间还没有发送心跳,那么kafka则会认为该消费者挂掉了,会重新进行reblancing。session.timeout.ms与消息的处理时间没有关系

转载于:https://my.oschina.net/u/732798/blog/2054811

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值