chia7712 commented on PR #16686:
URL: https://github.com/apache/kafka/pull/16686#issuecomment-2380888274

   After re-reading all the discussions, I’ll try to summarize the fixes for 
"close". Please correct me if I've misunderstood anything.
   
   **ConsumerRebalanceListener should execute during closing, regardless of 
timeout or interrupt** (this PR 
[KAFKA-16985](https://issues.apache.org/jira/browse/KAFKA-16985))
   1. The application thread must process the 
`ConsumerRebalanceListenerCallbackNeededEvent` before waiting for the 
`UnsubscribeEvent`.
   2. `ConsumerRebalanceListenerCallbackNeededEvent` should be interruptible.
   
   Therefore, we may need a specialized `processBackgroundEvents` method that 
keeps processing until the `ConsumerRebalanceListenerCallbackNeededEvent` is 
handled. Additionally, we should avoid swallowing the interrupt before this 
specialized `processBackgroundEvents`, so the interrupt can be properly 
propagated to the ConsumerRebalanceListener. After processing 
`ConsumerRebalanceListenerCallbackNeededEvent`, we should temporarily suppress 
the interrupt signal while waiting for the `UnsubscribeEvent`, and then restore 
the signal once the wait is complete.
   
   **The leave request should be attempted on a best-effort basis with honoring 
the interrupt and timeout** 
([KAFKA-17518](https://issues.apache.org/jira/browse/KAFKA-17518))
   1. `ConsumerNetworkThread#cleanup` must be interruptible
   2. application thread should propagate the interrupt signal to background 
thread
   
   Therefore, application thread should call `ConsumerNetworkThread#wakeup` to 
interrupt background thread if the `join` is interrupted.
   
   @kirktrue @lianetm WDYT? 


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