You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lh0156 (via GitHub)" <gi...@apache.org> on 2026/08/02 13:39:45 UTC
[PR] KAFKA-20869: Guard stream thread addition for global-only topologies [kafka]
lh0156 opened a new pull request, #23022:
URL: https://github.com/apache/kafka/pull/23022
### Summary
Prevent KafkaStreams#addStreamThread from creating a local StreamThread when the topology has no local processing tasks.
### Motivation
Global-only topologies intentionally start with zero local StreamThreads, even when num.stream.threads is configured with a positive value. Calling addStreamThread after startup must preserve that topology invariant; otherwise it creates a StreamThread that cannot build local tasks and can crash the client or repeatedly trigger thread replacement.
### Testing
- Added a regression test for a running global-only client that verifies no StreamThread is created and addStreamThread returns Optional.empty().
- Verified the test fails before the fix because addStreamThread creates a StreamThread and reaches an internal NullPointerException.
- ./gradlew :streams:check --no-build-cache --console=plain
Fixes KAFKA-20869
--
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