1996fanrui commented on code in PR #19723:
URL: https://github.com/apache/flink/pull/19723#discussion_r876755437


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateWriteRequest.java:
##########
@@ -103,18 +104,21 @@ static ChannelStateWriteRequest buildFutureWriteRequest(
                             checkBufferIsBuffer(buffer);
                             bufferConsumer.accept(writer, buffer);
                         }
-                    } catch (Throwable e) {
+                    } catch (ExecutionException e) {
                         writer.fail(e);
                     }
                 },
                 throwable -> {
-                    List<Buffer> buffers = dataFuture.get();
-                    if (buffers == null || buffers.isEmpty()) {
-                        return;
+                    try {
+                        List<Buffer> buffers = dataFuture.get();
+                        if (buffers == null || buffers.isEmpty()) {
+                            return;
+                        }
+                        CloseableIterator<Buffer> iterator =
+                                CloseableIterator.fromList(buffers, 
Buffer::recycleBuffer);
+                        iterator.close();
+                    } catch (ExecutionException ignored) {

Review Comment:
   ### Why do we need those changes?
   
   The writer.fail(e) needs be called after catch ExecutionException. It has 
been called in action, so discardAction shouldn't do anything. So I ignore the 
ExecutionException.
   
   ###  Also why are they in the commit that's adding unit tests?
   
   I found some unit tests failed during develop unit test due to catch 
Throwable in action. It will drop some exceptions from `writer.writeOutput`. So 
I change the Throwable to ExecutionException in action, and improved the catch 
in discardAction.



-- 
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]

Reply via email to