sunm2n commented on PR #23549:
URL: https://github.com/apache/kafka/pull/23549#issuecomment-6892348927

   Thanks @lucasbru!
   
   Not a deliberate choice for the consumer close, no. `TaskManager.shutdown` 
restores the flag so that its caller sees an interrupt it swallowed, and that 
was written before the `run()` change. Now that `run()` clears the flag up 
front, that restore only matters for an interrupt that arrives during 
`completeShutdown`, and in that case the consumers are closed with the flag 
set, as they were for every interrupt before this PR. The same holds for an 
interrupt that arrives after the state updater has stopped: it is not cleared 
at all, so the rest of the clean-up runs with it set.
   
   As you said, this should rarely happen, so I think it is fine to leave it as 
it is. It is also the same as before this PR, and an interrupt during the 
shutdown still shortens what is left of it. If you would rather have it handled 
the same way, I can clear the flag again in `completeShutdown` after 
`taskManager.shutdown` and restore it at the end, including the `CREATED` path 
where `completeShutdown` runs on the caller's thread.
   
   Filed KAFKA-21522 as the follow-up for `GlobalStreamThread`.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to