Skip to content

KAFKA-18066: Fix mismatched StreamThread ID in log messages #19517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

UladzislauBlok
Copy link

@UladzislauBlok UladzislauBlok commented Apr 19, 2025

This PR fixes an issue where the thread name shown in log messages did not match the actual execution context. Previously, log entries displayed the context of the newly created thread, while the logger reflected the current executing thread. This mismatch led to confusion and made log tracing more difficult.

Logs before fix:
18:20:42.861 [main] INFO o.a.k.s.p.internals.StreamThread - stream-thread [streams-linesplit-68754e82-1561-4482-a6cb-9f4b486c84ca-StreamThread-1] Creating restore consumer client
18:20:42.969 [main] INFO o.a.k.s.p.internals.StreamThread - stream-thread [streams-linesplit-68754e82-1561-4482-a6cb-9f4b486c84ca-StreamThread-1] Creating consumer client

Logs after fix:
18:33:02.098 [main] INFO o.a.k.s.p.internals.StreamThread - Creating restore consumer client for thread streams-linesplit-b7f8e5ab-841c-4fc9-8902-7fe9c9c06f55-StreamThread-1
18:33:02.214 [main] INFO o.a.k.s.p.internals.StreamThread - Creating consumer client for thread streams-linesplit-b7f8e5ab-841c-4fc9-8902-7fe9c9c06f55-StreamThread-1

Changes:

  • Use logger without context to not have context
  • Updated log messages to explicitly describe the thread being created
  • Fixed instances where the log context reflected the current thread instead of the newly created one

@github-actions github-actions bot added triage PRs from the community streams small Small PRs labels Apr 19, 2025
@UladzislauBlok UladzislauBlok changed the title KAFKA-18066 Fix mismatched StreamThread ID in log messages KAFKA-18066: Fix mismatched StreamThread ID in log messages Apr 19, 2025
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