ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream URL: https://github.com/apache/hadoop/pull/1791#discussion_r363454016
########## File path: hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemCreate.java ########## @@ -104,4 +107,39 @@ public void testCreateNonRecursive2() throws Exception { .close(); assertIsFile(fs, testFile); } + + /** + * Attempts to use to the ABFS stream after it is closed. + */ + @Test + public void testWriteAfterClose() throws Throwable { + final AzureBlobFileSystem fs = getFileSystem(); + Path testPath = new Path(TEST_FOLDER_PATH, TEST_CHILD_FILE); + FSDataOutputStream out = fs.create(testPath); + out.close(); + intercept(IOException.class, () -> out.write('a')); + intercept(IOException.class, () -> out.write(new byte[]{'a'})); + // hsync is not ignored on a closed stream + // out.hsync(); Review comment: Ok, certainly not critical so I'll resolve this comment. ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org