kirktrue commented on PR #16686: URL: https://github.com/apache/kafka/pull/16686#issuecomment-2445096615
Here is my latest interpretation of the tenets of `Consumer.close()` as affected by timeout and interrupt state: 1. The `ConsumerRebalanceListener` callback execution must be performed on the application thread 2. The `ConsumerRebalanceListener` callback execution must complete before attempting to leave the consumer group; “complete” does not imply success, execution is “complete” even if an error is thrown 3. Any error thrown during the `ConsumerRebalanceListener` callback execution will be handled and not prevent execution of the remaining `close()` logic 4. The application thread will block during the duration of the `ConsumerRebalanceListener` execution, regardless of interrupt state or the timeout provided; there is no mechanism inside `Consumer.close()` logic to short-circuit the callback execution 5. The application thread's interrupt state will be preserved for the `ConsumerRebalanceListener` execution 6. An attempt for the consumer to leave the group will be performed on a _best-case_ basis; there is no guarantee it will happen 7. An attempt for the consumer to leave the group is performed regardless of expired timeouts or interrupted state 8. The application thread will not wait for confirmation that the consumer left the group, even if there is remaining time 9. Leaving the consumer group is done by issuing a network request, and this must be performed on the background thread 10. The `close()` method should otherwise honor the timeout and interrupt flag, except where it would violate the previous tenets Do we agree on the above points? -- 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