[ 
https://issues.apache.org/jira/browse/KAFKA-19724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18021470#comment-18021470
 ] 

Matthias J. Sax commented on KAFKA-19724:
-----------------------------------------

Thanks for reporting the issue. – Not logging some exception is for sure a 
problem. This should be easy to fix.

While I agree that `globalStreamThread.setUncaughtExceptionHandler((t, e) -> \{ 
});` is not useful any longer, I don't think removing this code solves the 
problem. – In older version of KS, we use the Java uncaught exception handler, 
but we did move off it, in favor of a custom implementation. However, this 
custom implementation which allows to restart dying thread, only makes sense 
for `StreamsThreads`, but not for the `GlobalThread` – of the `GlobalThread` 
dies, we can only close KafkaStreams client with an ERROR state (what we do). 
[In AK 4.0, we remove the old code, and it seems we did not do a proper 
cleanup; that's all.]

But yes, we should fix the logging issue for sure.

> Global stream thread ignores all exceptions
> -------------------------------------------
>
>                 Key: KAFKA-19724
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19724
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 3.4.0
>            Reporter: Mikołaj Bul
>            Priority: Major
>
> {{globalStreamThread}} in {{KafkaStreams}} class ignores all exceptions and 
> fails to apply the user-provided {{StreamsUncaughtExceptionHandler}} in:
> {code:java}
> public void setUncaughtExceptionHandler(final StreamsUncaughtExceptionHandler 
> userStreamsUncaughtExceptionHandler)
> {code}
> This can lead to streams being stuck in faulty state after an exception is 
> thrown during their initialization phase (e.g. failure to load the RocksDB 
> native library). The exception isn't logged, so debugging such problem is 
> difficult.
> From my understanding of the {{b62d8b97}} commit message, the following code 
> is unnecessary as the {{globalStreamThread}} can't be replaced and the issue 
> description from KAFKA-12699 doesn't apply to it. Removing it should help.
> {code:java}
> if (globalStreamThread != null) {
>     globalStreamThread.setUncaughtExceptionHandler((t, e) -> { }
>     );
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to