Skip to content

Conversation

@celikfatih
Copy link
Contributor

@celikfatih celikfatih commented Oct 9, 2025

Kafka Streams does not catch Error types that occur during
GlobalStreamThread initiation, and therefore it is not possible to
trace the error (for example, an ExceptionInInitializerError occurs
when RocksDB is not found for a global store). This is because errors
are not caught and logged.

The catch block in GlobalStreamThread#initialize() has been ensured to
catch Throwable instead of Exception. Additionally, the empty
setUncaughtHandler set operation that prevented this from taking
effect when users employed setUncaughtExceptionHandler has been removed.

Reviewers: Matthias J. Sax [email protected]

@github-actions github-actions bot added triage PRs from the community streams small Small PRs labels Oct 9, 2025
@celikfatih celikfatih changed the title KAFKA-19724 KAFKA-19724 Global stream thread ignores all exceptions Oct 9, 2025
@mjsax mjsax added ci-approved and removed triage PRs from the community labels Oct 15, 2025
@mjsax mjsax changed the title KAFKA-19724 Global stream thread ignores all exceptions KAFKA-19724: Global stream thread should not ignore any exceptions Oct 15, 2025
Copy link
Member

@mjsax mjsax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Overall LGTM. One nit about naming.

@mjsax mjsax merged commit 2486cf1 into apache:trunk Oct 17, 2025
26 of 34 checks passed
mjsax pushed a commit that referenced this pull request Oct 17, 2025
…20668)

Kafka Streams does not catch Error types that occur during
`GlobalStreamThread` initiation, and therefore it is not possible to
trace the error (for example, an `ExceptionInInitializerError` occurs
when RocksDB is not found for a global store). This is because errors
are not caught and logged.

The catch block in `GlobalStreamThread#initialize()` has been ensured to
catch `Throwable` instead of `Exception`. Additionally, the empty
`setUncaughtHandler` set operation that prevented this from taking
effect when users employed setUncaughtExceptionHandler has been removed.

Reviewers: Matthias J. Sax <[email protected]>
mjsax pushed a commit that referenced this pull request Oct 17, 2025
…20668)

Kafka Streams does not catch Error types that occur during
`GlobalStreamThread` initiation, and therefore it is not possible to
trace the error (for example, an `ExceptionInInitializerError` occurs
when RocksDB is not found for a global store). This is because errors
are not caught and logged.

The catch block in `GlobalStreamThread#initialize()` has been ensured to
catch `Throwable` instead of `Exception`. Additionally, the empty
`setUncaughtHandler` set operation that prevented this from taking
effect when users employed setUncaughtExceptionHandler has been removed.

Reviewers: Matthias J. Sax <[email protected]>
@mjsax
Copy link
Member

mjsax commented Oct 17, 2025

Thanks for the fix! Merged to trunk and cherry-picked to 4.1, 4.0, and 3.9 branches.

mjsax pushed a commit that referenced this pull request Oct 17, 2025
…20668)

Kafka Streams does not catch Error types that occur during
`GlobalStreamThread` initiation, and therefore it is not possible to
trace the error (for example, an `ExceptionInInitializerError` occurs
when RocksDB is not found for a global store). This is because errors
are not caught and logged.

The catch block in `GlobalStreamThread#initialize()` has been ensured to
catch `Throwable` instead of `Exception`. Additionally, the empty
`setUncaughtHandler` set operation that prevented this from taking
effect when users employed setUncaughtExceptionHandler has been removed.

Reviewers: Matthias J. Sax <[email protected]>
eduwercamacaro pushed a commit to littlehorse-enterprises/kafka that referenced this pull request Nov 12, 2025
…pache#20668)

Kafka Streams does not catch Error types that occur during
`GlobalStreamThread` initiation, and therefore it is not possible to
trace the error (for example, an `ExceptionInInitializerError` occurs
when RocksDB is not found for a global store). This is because errors
are not caught and logged.

The catch block in `GlobalStreamThread#initialize()` has been ensured to
catch `Throwable` instead of `Exception`. Additionally, the empty
`setUncaughtHandler` set operation that prevented this from taking
effect when users employed setUncaughtExceptionHandler has been removed.

Reviewers: Matthias J. Sax <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants