You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "RivenSun2 (via GitHub)" <gi...@apache.org> on 2023/02/25 14:53:24 UTC
[GitHub] [kafka] RivenSun2 commented on a diff in pull request #13270: KAFKA-14729: The kafakConsumer pollForFetches(timer) method takes up a lot of cpu due to the abnormal exit of the heartbeat thread
RivenSun2 commented on code in PR #13270:
URL: https://github.com/apache/kafka/pull/13270#discussion_r1117934696
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:
##########
@@ -355,6 +355,12 @@ protected synchronized long timeToNextHeartbeat(long now) {
// we don't need to send heartbeats
if (state.hasNotJoinedGroup())
return Long.MAX_VALUE;
+ if (heartbeatThread != null) {
Review Comment:
@philipnee For a KafkaConsumer with group.id set and **assign** mode used. The coordinator will be created, but the heartbeat thread will not be created. So the non-null judgment here makes sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org