C0urante opened a new pull request #9003: URL: https://github.com/apache/kafka/pull/9003
A benign `WakeupException` can be thrown by a sink task's consumer if it's scheduled for shutdown by the worker. This is caught and handled gracefully if the exception is thrown when calling `poll` on the consumer, but not if called `commitSync`, which is invoked by a task during shutdown and also when its partition assignment is updated. If thrown during a partition assignment update, the `WakeupException` is caught and handled gracefully as part of the task's `iteration` loop. If thrown during shutdown, however, it is not caught and instead leads to the scary-looking log message "Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted.". These changes catch the `WakeupException` during shutdown and handle it gracefully with a `TRACE`-level log message. A unit test is added to verify this behavior by simulating a thrown `WakeupException` during `Consumer::commitSync`, running through the `WorkerSinkTask::execute` method, and confirming that it does not throw a `WakeupException` itself. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org