lucasbru opened a new pull request, #21500:
URL: https://github.com/apache/kafka/pull/21500

   `StoreChangelogReader.unregister()` incorrectly inferred the `SuspendReason` 
by checking whether the task state was `RUNNING`. Since `unregister()` is 
called from within the state updater thread where standby tasks are always in 
`RUNNING` state, `onUpdateSuspended()` always reported `PROMOTED` even when the 
task was actually being migrated.
   
   The fix passes the `SuspendReason` explicitly through the call chain from 
`TaskManager` → `StateUpdater.remove()` → `DefaultStateUpdater` → 
`ChangelogReader.unregister()`, removing the incorrect inference logic. 
`TaskManager` knows the actual reason: `PROMOTED` when recycling a standby task 
to active, and `MIGRATED` for all other cases (task closing, active recycling, 
input partition changes, revocation, shutdown).
   
   ### Committer Checklist (Completed)
   
   - [x] Spotless and checkstyle pass
   - [x] `StoreChangelogReaderTest`, `DefaultStateUpdaterTest`, 
`TaskManagerTest`, `TaskAndActionTest` all pass


-- 
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