You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "alanlau28 (via GitHub)" <gi...@apache.org> on 2026/07/24 13:53:33 UTC

[PR] KAFKA-20827: don't re-create an already-owned task on assignment [kafka]

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

   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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20827: don't re-create an already-owned task on assignment [kafka]

Posted by "bbejeck (via GitHub)" <gi...@apache.org>.
bbejeck merged PR #22925:
URL: https://github.com/apache/kafka/pull/22925


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20827: don't re-create an already-owned task on assignment [kafka]

Posted by "bbejeck (via GitHub)" <gi...@apache.org>.
bbejeck commented on PR #22925:
URL: https://github.com/apache/kafka/pull/22925#issuecomment-5074592311

   [System tests passing ](https://confluent-open-source-kafka-branch-builder-system-test-results.s3-us-west-2.amazonaws.com/trunk/2026-07-24--001.16063633-d1ef-4e20-b1e7-ff1c95f4ee77--1784926541--alanlau28--KAFKA-20827--de408981ff/report.html)


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20827: don't re-create an already-owned task on assignment [kafka]

Posted by "alanlau28 (via GitHub)" <gi...@apache.org>.
alanlau28 commented on PR #22925:
URL: https://github.com/apache/kafka/pull/22925#issuecomment-5073135743

   Thanks @bbejeck! I rewrote the tests. Also dropped the other half of the removeIf because it surfaced to be dead 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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20827: don't re-create an already-owned task on assignment [kafka]

Posted by "bbejeck (via GitHub)" <gi...@apache.org>.
bbejeck commented on PR #22925:
URL: https://github.com/apache/kafka/pull/22925#issuecomment-5075078711

   merged #22925 into trunk


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] KAFKA-20827: don't re-create an already-owned task on assignment [kafka]

Posted by "bbejeck (via GitHub)" <gi...@apache.org>.
bbejeck commented on PR #22925:
URL: https://github.com/apache/kafka/pull/22925#issuecomment-5078893213

   cherry-picked to 4.3


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org