apoorvmittal10 opened a new pull request, #17431:
URL: https://github.com/apache/kafka/pull/17431

   When Kafka Consumer is being closed then sometimes the wait goes for 30 secs 
as last telemetry push request doesn't get complete.
   
   The issue can only be reproduced when consumer is closed just after creating 
i.e. instantiated Kafka Consumer and closed it. When consumer is instantly 
closed then, then worker thread goes for timed_waiting state and expects last 
telemetry push request, which gets completed by background thread poll. But as 
the consumer is instantly closed, the heartbeat thread can't send the telemetry 
request, which makes the consumer close to wait for timeout.
   
   The PR addresses the concern by removing the timed waiting signal altogether 
and just update the state to `TERMINATING_PUSH_NEEDED`. If client triggers the 
next `poll` then the request will be sent else skipped. The last telemetry push 
request is good to have.
   
   The PR also moved the code for telemetry `initialize close` in Kafka 
Producer prior to `other` close. Otherwise reporters were closed prior call to 
`initialize close` of client telemetry reporter.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to