Nikita-Shupletsov commented on code in PR #23093:
URL: https://github.com/apache/kafka/pull/23093#discussion_r3730787976
##########
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:
ExceptionAndTask works only with RuntimeException. so we need to wrap the
Throwable into one in order to be able to pass it there(to
addToExceptionsAndFailedTasksThenClearUpdatingAndPausedTasks).
I decided to keep fatalException the same for the sake of consistency, but
it can be left as a throwable
--
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]