Nikita-Shupletsov commented on code in PR #23093:
URL: https://github.com/apache/kafka/pull/23093#discussion_r3737608580
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultStateUpdater.java:
##########
@@ -338,9 +351,18 @@ private KafkaFutureImpl<Uuid>
restoreConsumerInstanceId(final Duration timeout)
}
- private void handleRuntimeException(final RuntimeException
runtimeException) {
- log.error("An unexpected error occurred within the state updater
thread: {}", String.valueOf(runtimeException));
-
addToExceptionsAndFailedTasksThenClearUpdatingAndPausedTasks(runtimeException);
+ // Any throwable that escapes the update loop stops this thread. Even
for a throwable that is not recoverable,
+ // like an error, we report the tasks of this thread as failed, so
that the stream thread notices that this
+ // thread is gone instead of silently losing its tasks.
+ private void handleFatalThrowable(final Throwable throwable) {
+ log.error("An unexpected error occurred within the state updater
thread: {}", String.valueOf(throwable));
+ final RuntimeException exception = throwable instanceof
RuntimeException
+ ? (RuntimeException) throwable
+ : new StreamsException("The state updater thread failed with a
fatal error.", throwable);
Review Comment:
I wouldn't. mostly because we rely on everything to be an uchecked(runtime)
exception. Throwable is checked. so we would need to change every place that
deals with that exception downstream to be able to throw the Throwable. which
would basically mean a similar check and a similar wrapping.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]