mitsa-ng opened a new pull request, #24346: URL: https://github.com/apache/kafka/pull/24346
A paused task keeps its changelogs registered and assigned to the restore consumer, so the consumer can still raise a TaskCorruptedException that names a paused task, for example when a fetch that was in flight while the task was paused returns OFFSET_OUT_OF_RANGE, or when position validation after a leader change detects truncation. `handleTaskCorruptedException` only looked up tasks in `updatingTasks` and threw an `IllegalStateException` that killed the state updater thread (failing every task) when the corrupted task was paused. Handle a corrupted paused task the same way as a corrupted updating one, mirroring how `handleStreamsExceptionWithTask` already treats paused tasks: mark its changelogs as corrupted, checkpoint to drop them, unregister the changelogs from the changelog reader, and add the task to the exceptions and failed tasks instead of throwing. Testing strategy: added `shouldHandleTaskCorruptedExceptionForPausedTaskAndAddFailedTasksToQueue` to `DefaultStateUpdaterTest` that pauses a task first, then triggers a `TaskCorruptedException` naming it and verifies the task lands in the exceptions and failed tasks (instead of killing the thread), its changelogs are unregistered and marked corrupted, the updating task is untouched, and the state updater keeps running. The test fails with an IllegalStateException on the previous code. -- 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]
