[ https://issues.apache.org/jira/browse/KAFKA-12699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326215#comment-17326215 ]
A. Sophie Blee-Goldman commented on KAFKA-12699: ------------------------------------------------ To be fair, I think claiming that this is a bug that Streams "no longer overrides the java default handler" is a bit harsh since (a) as you point out, this isn't a regression but just a different behavior in a new feature, and (b) it was never specified or implied that the new feature would do exactly the same thing as the old feature. I would actually argue that continuing to override the java default handler when the user has not actually supplied a Thread.UncaughtExceptionHandler to override it would be more unexpected. However, I do think it's a bit odd that we would end up invoking the default thread uncaught exception handler at all, since Streams will have already caught and invoked the user-defined handler at that point. The "bug" from my perspective is that we rethrow the exception up through run(), vs swallowing it once we reach the outer try in StreamThread#run. If we think that the user-defined default handler should not be invoked when using the new StreamsUncaughtExceptionHandler (and I think that assumption is not a given, although I don't feel strongly for or against), and should be overriden with a no-op handler, then why continue to throw the exception. And if we don't throw the exception, then why do we need to override with a no-op -- just my line of thinking, again I'm not sure what a realistic user expected behavior is here. But setting a global exception handler and then just blindly calling System.exit in a multi-threaded app where you've consciously implemented a handler that makes it clear threads can die and be replaced...seems like user error to me > Streams no longer overrides the java default uncaught exception handler > ------------------------------------------------------------------------- > > Key: KAFKA-12699 > URL: https://issues.apache.org/jira/browse/KAFKA-12699 > Project: Kafka > Issue Type: Bug > Components: streams > Affects Versions: 2.8.0 > Reporter: Walker Carlson > Priority: Minor > > If a user used `Thread.setUncaughtExceptionHanlder()` to set the handler for > all threads in the runtime streams would override that with its own handler. > However since streams does not use the `Thread` handler anymore it will no > longer do so. This can cause problems if the user does something like > `System.exit(1)` in the handler. > > If using the old handler in streams it will still work as it used to -- This message was sent by Atlassian Jira (v8.3.4#803005)