lianetm commented on PR #16686: URL: https://github.com/apache/kafka/pull/16686#issuecomment-2315521379
Hey @kirktrue, sorry if I didn't communicate my point clearly. I see your concern: > But I'm not seeing that the Timer object is updated, cleared, or reset, though. Agree, but the thing is I never meant that the Classic plays with the timer. I've been only suggesting that playing with the timer is the best way I see to achieve with the new consumer what the classic one currently achieves in a different way. > I'm not aware of anywhere in AsyncKafkaConsumer.releaseAssignmentAndLeaveGroup() where we wait for the response from the server 1. I expect we would be sitting and waiting for responses to the leave group [here](https://github.com/apache/kafka/blob/f9615ed275c3856b73e5b6083049a8def9f59697/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L1288), because the `UnsubscribeEvent` does not complete until it receives the response to the HB to leave. 2. We would also sit and wait for responses to any previous in-flight request [here](https://github.com/apache/kafka/blob/f9615ed275c3856b73e5b6083049a8def9f59697/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThread.java#L303), because the network thread won't complete closing until it gets responses for all unsent/in-flights (or timer expires). Also, regarding: > the classic consumer does check (and clear) the flag It clears the flag indeed, but then throws interrupted (so the flag is flipped back on), meaning that even if it swallows the exception temporarily to attempt the next close actions, the thread is still interrupted (so next close action that attempts poll won't wait for responses either). Makes sense? In order to make progress here, I have 2 questions: 1. Do we agree that what we want to achieve on interrupt + close is to take all close actions but without waiting for broker responses? 2. If we agree on 1 about what we want, then question is how to do it? I suggested the option of ignoring the interrupted status + `close(0)` because seems to me that it gets us to the result we want, but if we have an alternative I'm open to it. Thanks! This is definitely a tricky one :) -- 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