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

   Fix to ensure that the HB request to leave the group is generated when 
closing the HBRequestManager if the state is LEAVING. This is needed because we 
could end up closing the network thread without giving a chance to the 
HBManager to generate the request. This flow on consumer.close with short 
timeout:
    
   1. app thread triggers releaseAssignmentAndLeaveGroup
   2. background thread transitions to LEAVING 
       2.1 the next run of the background thread should poll the HB manager and 
generate a request
   3. app thread releaseAssignmentAndLeaveGroup times out and moves on to close 
the network thread (stops polling managers. Calls pollOnClose to gather the 
final requests and send them along with the unsent)
   
   If 3 happens in the app thread before 2.1 happens in the background, the HB 
manager won't have a chance to generate the request to leave. This PR 
implements the pollOnClose to generate the final request if needed.


-- 
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