Skip to content

KAFKA-20869: Guard stream thread addition for global-only topologies - #23022

Open
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-20869-global-only-add-streams-thread
Open

KAFKA-20869: Guard stream thread addition for global-only topologies#23022
lh0156 wants to merge 1 commit into
apache:trunkfrom
lh0156:agent/KAFKA-20869-global-only-add-streams-thread

Conversation

@lh0156

@lh0156 lh0156 commented Aug 2, 2026

Copy link
Copy Markdown

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

Prevent addStreamThread from creating a local stream thread when the topology has no local processing tasks. Add a regression test covering a running global-only client.

Generated-by: OpenAI Codex (GPT-5)
@github-actions github-actions Bot added triage PRs from the community streams small Small PRs labels Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small Small PRs streams triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant