You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/04/01 15:59:48 UTC

[GitHub] [flink] XComp commented on a change in pull request #19304: [FLINK-26957][runtime] Removes flush in FileSystemJobResultStore.createDirtyResultInternal

XComp commented on a change in pull request #19304:
URL: https://github.com/apache/flink/pull/19304#discussion_r840723905



##########
File path: flink-core/src/main/java/org/apache/flink/core/fs/local/LocalDataOutputStream.java
##########
@@ -47,31 +52,49 @@ public LocalDataOutputStream(final File file) throws IOException {
 
     @Override
     public void write(final int b) throws IOException {
+        mayThrowClosedChannelException();
+        fos.write(b);
+    }
+
+    @Override
+    public void write(@Nonnull final byte[] b) throws IOException {
+        mayThrowClosedChannelException();
         fos.write(b);
     }
 
     @Override
     public void write(final byte[] b, final int off, final int len) throws IOException {
+        mayThrowClosedChannelException();
         fos.write(b, off, len);
     }
 
     @Override
     public void close() throws IOException {
         fos.close();
+        isClosed = true;

Review comment:
       The intention was that we don't flag it if there's an error in `fos.close()` because we don't know, whether the closing actual happen. But thinking about it once more, you might be right: The caller had the intention of closing the `OutpuStream`, i.e. no call accessing the stream should be possible anymore in the caller code even if an error occurred. 👍 




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org