Github user StefanRRichter commented on a diff in the pull request: https://github.com/apache/flink/pull/4550#discussion_r133663689 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/state/StateUtil.java --- @@ -49,27 +49,8 @@ public static long getStateSize(StateObject handle) { * @throws Exception exception that is a collection of all suppressed exceptions that were caught during iteration */ public static void bestEffortDiscardAllStateObjects( - Iterable<? extends StateObject> handlesToDiscard) throws Exception { - - if (handlesToDiscard != null) { - Exception exception = null; - - for (StateObject state : handlesToDiscard) { - - if (state != null) { - try { - state.discardState(); - } - catch (Exception ex) { - exception = ExceptionUtils.firstOrSuppressed(ex, exception); - } - } - } - - if (exception != null) { - throw exception; - } - } + Iterable<? extends StateObject> handlesToDiscard) throws Exception { + LambdaUtil.applyToAllWhileSuppressingExceptions(handlesToDiscard, StateObject::discardState); --- End diff -- Not strictly, but I would like to keep it.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---