You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lucasbru (via GitHub)" <gi...@apache.org> on 2026/02/17 20:46:03 UTC
[PR] KAFKA-16836: Fix incorrect suspend reason in standby update listener [kafka]
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-16836: Fix incorrect suspend reason in standby update listener [kafka]
Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru merged PR #21500:
URL: https://github.com/apache/kafka/pull/21500
--
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-16836: Fix incorrect suspend reason in standby update listener [kafka]
Posted by "frankvicky (via GitHub)" <gi...@apache.org>.
frankvicky commented on code in PR #21500:
URL: https://github.com/apache/kafka/pull/21500#discussion_r2824091670
##########
streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java:
##########
@@ -1159,6 +1159,10 @@ public void register(final Set<TopicPartition> changelogPartitions, final Proces
@Override
public void unregister(final Collection<TopicPartition> partitions) { }
+
+ @Override
+ public void unregister(final Collection<TopicPartition> partitions,
+ final org.apache.kafka.streams.processor.StandbyUpdateListener.SuspendReason reason) { }
Review Comment:
ditto
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/MockChangelogReader.java:
##########
@@ -91,6 +91,12 @@ public void unregister(final Collection<TopicPartition> partitions) {
}
}
+ @Override
+ public void unregister(final Collection<TopicPartition> partitions,
+ final org.apache.kafka.streams.processor.StandbyUpdateListener.SuspendReason reason) {
Review Comment:
Could we use import instead of full qualifed name?
--
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-16836: Fix incorrect suspend reason in standby update listener [kafka]
Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru commented on code in PR #21500:
URL: https://github.com/apache/kafka/pull/21500#discussion_r2827435472
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/MockChangelogReader.java:
##########
@@ -91,6 +91,12 @@ public void unregister(final Collection<TopicPartition> partitions) {
}
}
+ @Override
+ public void unregister(final Collection<TopicPartition> partitions,
+ final org.apache.kafka.streams.processor.StandbyUpdateListener.SuspendReason reason) {
Review Comment:
Done.
##########
streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java:
##########
@@ -1159,6 +1159,10 @@ public void register(final Set<TopicPartition> changelogPartitions, final Proces
@Override
public void unregister(final Collection<TopicPartition> partitions) { }
+
+ @Override
+ public void unregister(final Collection<TopicPartition> partitions,
+ final org.apache.kafka.streams.processor.StandbyUpdateListener.SuspendReason reason) { }
Review Comment:
Done.
--
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