feyman2016 commented on a change in pull request #8887: URL: https://github.com/apache/kafka/pull/8887#discussion_r441468868
########## File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java ########## @@ -1048,4 +1042,28 @@ public String toString(final String indent) { Set<TaskId> lockedTaskDirectories() { return Collections.unmodifiableSet(lockedTaskDirectories); } + + public static void executeAndMaybeSwallow(final boolean clean, + final Runnable runnable, + final java.util.function.Consumer<RuntimeException> actionIfClean, + final java.util.function.Consumer<RuntimeException> actionIfNotClean) { Review comment: At first thought, the not `clean` case normally just do some logs. with only the log string different, I would like to still use the `executeAndMaybeSwallow ` in `Task.scala`, but since callers may need different log levels or they may want do more than just a log, so just pass a more generic argument `actionIfNotClean`. And yeah, `java.util.function.Consumer` looks ugly but I am not aware of some elegant way for import alias... ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org