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

   Backport of #22925 to 4.2, adapted for the older branch:
    - createNewTasks keeps its Collection<Task> locals; trunk narrowed 
ActiveTaskCreator/StandbyTaskCreator.createTasks to 
Collection<StreamTask>/Collection<StandbyTask>, but on 4.2 they still return 
Collection<Task>.
    - The regression tests build the TaskManager with 
setUpTaskManagerWithStateUpdater(...); 4.2's default test setup uses a null 
state updater that checkStateUpdater would dereference
    
   A task that fails to (re)initialize is left owned (registered and flagged 
failed) to be reconciled via the corruption/failed-task path. It is excluded 
from handleAssignment's rectify-existing pass (which iterates only non-failed 
tasks), so the next assignment builds a SECOND representation of it in 
createNewTasks; that duplicate fails init and trips the single-owner invariant 
in Tasks.addStandbyTask/addActiveTask (IllegalStateException: 'Attempted to 
create an standby task that we already own'), killing the StreamThread from an 
otherwise recoverable path.
   
   createNewTasks now skips creating any task the registry already owns 
(including failed ones), so the duplicate is never built and the single-owner 
invariant stays strict. Adds a TaskManagerTest regression test.


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