[
https://issues.apache.org/jira/browse/KAFKA-21031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
TengYao Chi resolved KAFKA-21031.
---------------------------------
Resolution: Fixed
> Another busy loop happens while a heartbeat is in flight and the heartbeat
> timer is expired
> -------------------------------------------------------------------------------------------
>
> Key: KAFKA-21031
> URL: https://issues.apache.org/jira/browse/KAFKA-21031
> Project: Kafka
> Issue Type: Bug
> Components: clients, consumer
> Reporter: Eric Chang
> Assignee: Eric Chang
> Priority: Major
> Fix For: 4.5.0
>
>
> Code inspection found that a group heartbeat manager can return a zero poll
> timeout
> while a heartbeat request is still in flight.
> When the heartbeat timer expires,
> \{{HeartbeatRequestState.timeToNextHeartbeatMs()}}
> falls through to the remaining retry backoff. That backoff is measured from
> the last
> response, so it is normally already 0. The heartbeat managers propagate this
> value
> through \{{poll()}} and \{{maximumTimeToWait()}}, so the network and
> application threads
> busy loop until the response arrives or the request times out.
> This happens after the member has joined (typically \{{STABLE}}). The client
> has
> learned the heartbeat interval and sent a later heartbeat, but the response
> does not
> arrive before that interval elapses. The heartbeat timer expires while the
> request
> remains in flight, and the request has not yet reached
> \{{request.timeout.ms}}.
> The fix is to return the initial retry backoff in this state. It applies to
> the
> consumer, share and streams heartbeat managers because they share
> {\{HeartbeatRequestState}}.
> Out of scope:
> * The first heartbeat while joining is covered by KAFKA-19804, which starts
> the
> heartbeat timer with \{{request.timeout.ms}} as the interval.
> * \{{retry.backoff.ms=0}} still results in a zero wait. This is tracked
> consistently
> across the request managers in KAFKA-21049.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)