You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/01/03 17:03:09 UTC

[GitHub] [hadoop] steveloughran opened a new pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

steveloughran opened a new pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791
 
 
   
   adds
   * fix for problem
   * test for fix
   * an extra assert to help debug abfs test config
   * and LTU.intercept to declare class of expected exception when none
   was raised.
   
   Change-Id: I37951f0a3881d9b9849c4a51159d6670583f65c1
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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_r363432586
 
 

 ##########
 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:
   Why is hsync special?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran 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_r363445962
 
 

 ##########
 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();
+    out.flush();
+    out.close();
+  }
+
+  /**
+   * Attempts to double close an ABFS output stream from within a
+   * FilterOutputStream.
+   * That class handles a double failure on close badly if the second
+   * exception rethrows the first.
+   */
+  @Test
+  public void testFilteredDoubleClose() throws Throwable {
 
 Review comment:
   You are right, I couldn't think how to reliably replicate it. without going near mockito etc., 
   
   or we add a package level setLastError() call? 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571741690
 
 
   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m 12s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 4 new or modified test files.  |
   ||| _ trunk Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 25s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  30m 55s |  trunk passed  |
   | +1 :green_heart: |  compile  |  29m 31s |  trunk passed  |
   | +1 :green_heart: |  checkstyle  |   2m 32s |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m 12s |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  20m 21s |  branch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m  4s |  trunk passed  |
   | +0 :ok: |  spotbugs  |   1m  2s |  Used deprecated FindBugs config; considering switching to SpotBugs.  |
   | +1 :green_heart: |  findbugs  |   3m  1s |  trunk passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 25s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   1m 21s |  the patch passed  |
   | +1 :green_heart: |  compile  |  17m  7s |  the patch passed  |
   | +1 :green_heart: |  javac  |  17m  7s |  the patch passed  |
   | +1 :green_heart: |  checkstyle  |   2m 33s |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   2m  2s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  shadedclient  |  12m 21s |  patch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m 10s |  the patch passed  |
   | +1 :green_heart: |  findbugs  |   3m 28s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   9m 18s |  hadoop-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m 35s |  hadoop-azure in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 51s |  The patch does not generate ASF License warnings.  |
   |  |   | 145m 44s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/5/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1791 |
   | JIRA Issue | HADOOP-16785 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 938169794dd1 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / bc366d4 |
   | Default Java | 1.8.0_232 |
   |  Test Results | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/5/testReport/ |
   | Max. process+thread count | 1372 (vs. ulimit of 5500) |
   | modules | C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-azure U: . |
   | Console output | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/5/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus removed a comment on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
hadoop-yetus removed a comment on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571209228
 
 
   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   2m 28s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 4 new or modified test files.  |
   ||| _ trunk Compile Tests _ |
   | +0 :ok: |  mvndep  |   1m 52s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  19m  6s |  trunk passed  |
   | +1 :green_heart: |  compile  |  17m 40s |  trunk passed  |
   | +1 :green_heart: |  checkstyle  |   2m 49s |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m  6s |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  19m 37s |  branch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m  6s |  trunk passed  |
   | +0 :ok: |  spotbugs  |   1m  0s |  Used deprecated FindBugs config; considering switching to SpotBugs.  |
   | +1 :green_heart: |  findbugs  |   3m 12s |  trunk passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 26s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   1m 18s |  the patch passed  |
   | +1 :green_heart: |  compile  |  17m 10s |  the patch passed  |
   | +1 :green_heart: |  javac  |  17m 10s |  the patch passed  |
   | +1 :green_heart: |  checkstyle  |   2m 44s |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   2m  4s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  shadedclient  |  13m  4s |  patch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m 14s |  the patch passed  |
   | +1 :green_heart: |  findbugs  |   3m 26s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   9m 19s |  hadoop-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m 34s |  hadoop-azure in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 54s |  The patch does not generate ASF License warnings.  |
   |  |   | 126m  2s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/2/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1791 |
   | JIRA Issue | HADOOP-16785 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux ffaaa026f726 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 4a76ab7 |
   | Default Java | 1.8.0_232 |
   |  Test Results | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/2/testReport/ |
   | Max. process+thread count | 1375 (vs. ulimit of 5500) |
   | modules | C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-azure U: . |
   | Console output | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/2/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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_r363403741
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java
 ##########
 @@ -1198,6 +1201,17 @@ public void setEncodedKey(String anEncodedKey) {
     private void restoreKey() throws IOException {
       store.rename(getEncodedKey(), getKey());
     }
+
+    /**
+     * Check for the stream being open.
+     * @throws IOException if the stream is closed.
+     */
+    private void checkOpen() throws IOException {
 
 Review comment:
   We should check for stream closure for all the methods in my opinion, if we are going to check for some of them.  In particular, we should check for flush() which is inherited and hflush, hsync and hasCapabilities (also sync for branch-2).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-570633450
 
 
   Tested: azure wales
   
   @bgaborg , @ThomasMarquardt  -fancy a quick look at this? 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571209228
 
 
   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   2m 28s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 4 new or modified test files.  |
   ||| _ trunk Compile Tests _ |
   | +0 :ok: |  mvndep  |   1m 52s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  19m  6s |  trunk passed  |
   | +1 :green_heart: |  compile  |  17m 40s |  trunk passed  |
   | +1 :green_heart: |  checkstyle  |   2m 49s |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m  6s |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  19m 37s |  branch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m  6s |  trunk passed  |
   | +0 :ok: |  spotbugs  |   1m  0s |  Used deprecated FindBugs config; considering switching to SpotBugs.  |
   | +1 :green_heart: |  findbugs  |   3m 12s |  trunk passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 26s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   1m 18s |  the patch passed  |
   | +1 :green_heart: |  compile  |  17m 10s |  the patch passed  |
   | +1 :green_heart: |  javac  |  17m 10s |  the patch passed  |
   | +1 :green_heart: |  checkstyle  |   2m 44s |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   2m  4s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  shadedclient  |  13m  4s |  patch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m 14s |  the patch passed  |
   | +1 :green_heart: |  findbugs  |   3m 26s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   9m 19s |  hadoop-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m 34s |  hadoop-azure in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 54s |  The patch does not generate ASF License warnings.  |
   |  |   | 126m  2s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/2/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1791 |
   | JIRA Issue | HADOOP-16785 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux ffaaa026f726 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 4a76ab7 |
   | Default Java | 1.8.0_232 |
   |  Test Results | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/2/testReport/ |
   | Max. process+thread count | 1375 (vs. ulimit of 5500) |
   | modules | C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-azure U: . |
   | Console output | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/2/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus removed a comment on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
hadoop-yetus removed a comment on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571215129
 
 
   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m 11s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 4 new or modified test files.  |
   ||| _ trunk Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 25s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  19m 46s |  trunk passed  |
   | +1 :green_heart: |  compile  |  17m 47s |  trunk passed  |
   | +1 :green_heart: |  checkstyle  |   2m 31s |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m  6s |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  18m 51s |  branch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m  3s |  trunk passed  |
   | +0 :ok: |  spotbugs  |   1m  1s |  Used deprecated FindBugs config; considering switching to SpotBugs.  |
   | +1 :green_heart: |  findbugs  |   3m  7s |  trunk passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 22s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   1m 17s |  the patch passed  |
   | +1 :green_heart: |  compile  |  17m 15s |  the patch passed  |
   | +1 :green_heart: |  javac  |  17m 15s |  the patch passed  |
   | +1 :green_heart: |  checkstyle  |   2m 31s |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   2m  8s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  shadedclient  |  14m 20s |  patch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m 14s |  the patch passed  |
   | +1 :green_heart: |  findbugs  |   3m 20s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   9m  9s |  hadoop-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m 38s |  hadoop-azure in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 53s |  The patch does not generate ASF License warnings.  |
   |  |   | 123m 15s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/3/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1791 |
   | JIRA Issue | HADOOP-16785 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 543c92b9b053 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 4a76ab7 |
   | Default Java | 1.8.0_232 |
   |  Test Results | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/3/testReport/ |
   | Max. process+thread count | 1373 (vs. ulimit of 5500) |
   | modules | C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-azure U: . |
   | Console output | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/3/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran 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_r363444377
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java
 ##########
 @@ -1198,6 +1201,17 @@ public void setEncodedKey(String anEncodedKey) {
     private void restoreKey() throws IOException {
       store.rename(getEncodedKey(), getKey());
     }
+
+    /**
+     * Check for the stream being open.
+     * @throws IOException if the stream is closed.
+     */
+    private void checkOpen() throws IOException {
 
 Review comment:
   yes, some bits of code do call flush() after its closed, so its safest to no-op it.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-570667314
 
 
   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m 13s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 3 new or modified test files.  |
   ||| _ trunk Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 25s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  21m 40s |  trunk passed  |
   | +1 :green_heart: |  compile  |  16m 42s |  trunk passed  |
   | +1 :green_heart: |  checkstyle  |   2m 38s |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m 14s |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  18m 56s |  branch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m 13s |  trunk passed  |
   | +0 :ok: |  spotbugs  |   1m  2s |  Used deprecated FindBugs config; considering switching to SpotBugs.  |
   | +1 :green_heart: |  findbugs  |   3m  3s |  trunk passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 25s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   1m 15s |  the patch passed  |
   | +1 :green_heart: |  compile  |  15m 48s |  the patch passed  |
   | +1 :green_heart: |  javac  |  15m 48s |  the patch passed  |
   | +1 :green_heart: |  checkstyle  |   2m 37s |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   2m 11s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  shadedclient  |  12m 53s |  patch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m 11s |  the patch passed  |
   | +1 :green_heart: |  findbugs  |   3m 24s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   9m 13s |  hadoop-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m 38s |  hadoop-azure in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 54s |  The patch does not generate ASF License warnings.  |
   |  |   | 121m 55s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/1/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1791 |
   | JIRA Issue | HADOOP-16785 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux d3a2744d8dab 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 037ec8c |
   | Default Java | 1.8.0_232 |
   |  Test Results | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/1/testReport/ |
   | Max. process+thread count | 1367 (vs. ulimit of 5500) |
   | modules | C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-azure U: . |
   | Console output | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/1/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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_r363422859
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsOutputStream.java
 ##########
 @@ -259,7 +259,15 @@ public synchronized void close() throws IOException {
   }
 
   private synchronized void flushInternal(boolean isClose) throws IOException {
-    maybeThrowLastError();
+    try {
+      maybeThrowLastError();
+    } catch (IOException e) {
+      if (isClose) {
+        // wrap existing exception so as to avoid breaking try-with-resources
+        throw new IOException("Skipping final flush and write due to " + e, e);
+      } else
+        throw e;
+    }
 
 Review comment:
   Instead, I think we should update AbfsOutputStream.close to wrap the exception, short of having the Java implementers fix this. :)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran closed pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran closed pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571278717
 
 
   checkstyle
   ```
   /hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsOutputStream.java:268:      } else: 'else' construct must use '{}'s. [NeedBraces]
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran 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_r363860201
 
 

 ##########
 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();
+    out.flush();
+    out.close();
+  }
+
+  /**
+   * Attempts to double close an ABFS output stream from within a
+   * FilterOutputStream.
+   * That class handles a double failure on close badly if the second
+   * exception rethrows the first.
+   */
+  @Test
+  public void testFilteredDoubleClose() throws Throwable {
 
 Review comment:
   yes, write+delete does the trick

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-575173353
 
 
   added a followup #1809  -an extra test to confirm the filter output stream close was happy

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571175415
 
 
   
   I can't replicate that in the test -but can see how it does surface...it's in the close() of a try-with-resources
   
   * If a call like out.flush() raises an IOE, try-with-resources tries to close the stream
   * and an exception from close() is added to the first IOE via addSuppressed
   * which doesn't let you add the caught exception to itself.
   * So if the ABFS stream close() always rethrows the same exception, you get a failure.
   * This could happen if there had been some previous failure and maybeRethrowException() was throwing it - the final 
     flushInternal() call will throw the same exception, so addSuppressed will fail.
     
   I'm patching flushInternal() so that if it rethrows an exception in close, it wraps that with a covering IOE. (it still nests the inner, so there is a loop in the chain).
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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_r363435811
 
 

 ##########
 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();
+    out.flush();
+    out.close();
+  }
+
+  /**
+   * Attempts to double close an ABFS output stream from within a
+   * FilterOutputStream.
+   * That class handles a double failure on close badly if the second
+   * exception rethrows the first.
+   */
+  @Test
+  public void testFilteredDoubleClose() throws Throwable {
 
 Review comment:
   Double close would have already been passing with these changes.  To really test the try-with-resources I think you need to modify the underlying blob after fs.create but before flush so that flush fails and sets AbfsOutputStream.lastError.  For example, if you write some data to the blob so that the position held by the AbfsOutputStream is invalid, flush may fail.  For example, the following test:
   
   out = fs.create(path)
   out.write('a');
   // externally write data to the same path so that the next call to flush will fail due to position being off.
    intercept(IOException.class, () -> out.flush());
    intercept(IOException.class, () -> out.close());

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran 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_r363444853
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsOutputStream.java
 ##########
 @@ -259,7 +259,15 @@ public synchronized void close() throws IOException {
   }
 
   private synchronized void flushInternal(boolean isClose) throws IOException {
-    maybeThrowLastError();
+    try {
+      maybeThrowLastError();
+    } catch (IOException e) {
+      if (isClose) {
+        // wrap existing exception so as to avoid breaking try-with-resources
+        throw new IOException("Skipping final flush and write due to " + e, e);
+      } else
+        throw e;
+    }
 
 Review comment:
   thought of that, but also thought it might be good to differentiate exception raised in the later bits of the flush. Keeping it in close() is cleaner as it puts the problem where it belongs

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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_r363431500
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java
 ##########
 @@ -1198,6 +1201,17 @@ public void setEncodedKey(String anEncodedKey) {
     private void restoreKey() throws IOException {
       store.rename(getEncodedKey(), getKey());
     }
+
+    /**
+     * Check for the stream being open.
+     * @throws IOException if the stream is closed.
+     */
+    private void checkOpen() throws IOException {
 
 Review comment:
   After thinking about this, I have changed my mind and no longer think it is necessary to check for closure inside flush, hflush, hsync, or hasCapabilities.  These are no-ops when the buffers are empty, except for hasCapabilities which doesn't throw (so it doesn't even make sense for hasCapabilities to check).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran 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_r363445286
 
 

 ##########
 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:
   no idea, it just failed for me *and I wasn't worried about it*. flush() is the one I care about as that I know can get called in some places when closed (compression libs etc, so nothing we can fix).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571688326
 
 
   Updated patch adds the test recommended by thomas and wraps the exception in close, while retaining the class of the original exception.
   
   Tested: ABFS wales. It's very fast :)
   
   * the new tests HADOOP-16455 failed, I don't have an oauth2.client.id . Taking up on the JIRA.
   * .ITestClientUrlScheme fails as my a/c is HTTPS only

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571215129
 
 
   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m 11s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  1s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 4 new or modified test files.  |
   ||| _ trunk Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 25s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  19m 46s |  trunk passed  |
   | +1 :green_heart: |  compile  |  17m 47s |  trunk passed  |
   | +1 :green_heart: |  checkstyle  |   2m 31s |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m  6s |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  18m 51s |  branch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m  3s |  trunk passed  |
   | +0 :ok: |  spotbugs  |   1m  1s |  Used deprecated FindBugs config; considering switching to SpotBugs.  |
   | +1 :green_heart: |  findbugs  |   3m  7s |  trunk passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 22s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   1m 17s |  the patch passed  |
   | +1 :green_heart: |  compile  |  17m 15s |  the patch passed  |
   | +1 :green_heart: |  javac  |  17m 15s |  the patch passed  |
   | +1 :green_heart: |  checkstyle  |   2m 31s |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   2m  8s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  shadedclient  |  14m 20s |  patch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m 14s |  the patch passed  |
   | +1 :green_heart: |  findbugs  |   3m 20s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   9m  9s |  hadoop-common in the patch passed.  |
   | +1 :green_heart: |  unit  |   1m 38s |  hadoop-azure in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 53s |  The patch does not generate ASF License warnings.  |
   |  |   | 123m 15s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/3/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1791 |
   | JIRA Issue | HADOOP-16785 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 543c92b9b053 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 4a76ab7 |
   | Default Java | 1.8.0_232 |
   |  Test Results | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/3/testReport/ |
   | Max. process+thread count | 1373 (vs. ulimit of 5500) |
   | modules | C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-azure U: . |
   | Console output | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/3/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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_r363453384
 
 

 ##########
 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();
+    out.flush();
+    out.close();
+  }
+
+  /**
+   * Attempts to double close an ABFS output stream from within a
+   * FilterOutputStream.
+   * That class handles a double failure on close badly if the second
+   * exception rethrows the first.
+   */
+  @Test
+  public void testFilteredDoubleClose() throws Throwable {
 
 Review comment:
   I think you can simply create a second stream for the same path, or even call delete on it after writing some data with the other stream.  Basically, write to the same path with two streams.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
hadoop-yetus commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571242097
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m 12s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  The patch appears to include 4 new or modified test files.  |
   ||| _ trunk Compile Tests _ |
   | +0 :ok: |  mvndep  |   1m 18s |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |  20m 49s |  trunk passed  |
   | +1 :green_heart: |  compile  |  17m 29s |  trunk passed  |
   | +1 :green_heart: |  checkstyle  |   2m 49s |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m  0s |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  19m 41s |  branch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   1m 55s |  trunk passed  |
   | +0 :ok: |  spotbugs  |   0m 58s |  Used deprecated FindBugs config; considering switching to SpotBugs.  |
   | +1 :green_heart: |  findbugs  |   3m  1s |  trunk passed  |
   ||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 21s |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   1m 13s |  the patch passed  |
   | +1 :green_heart: |  compile  |  16m 51s |  the patch passed  |
   | +1 :green_heart: |  javac  |  16m 51s |  the patch passed  |
   | -0 :warning: |  checkstyle  |   2m 58s |  root: The patch generated 1 new + 29 unchanged - 0 fixed = 30 total (was 29)  |
   | +1 :green_heart: |  mvnsite  |   2m 13s |  the patch passed  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  shadedclient  |  14m 13s |  patch has no errors when building and testing our client artifacts.  |
   | +1 :green_heart: |  javadoc  |   2m  2s |  the patch passed  |
   | +1 :green_heart: |  findbugs  |   3m 38s |  the patch passed  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  |   8m 56s |  hadoop-common in the patch failed.  |
   | +1 :green_heart: |  unit  |   1m 32s |  hadoop-azure in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 45s |  The patch does not generate ASF License warnings.  |
   |  |   | 124m 39s |   |
   
   
   | Reason | Tests |
   |-------:|:------|
   | Failed junit tests | hadoop.security.TestFixKerberosTicketOrder |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/4/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/1791 |
   | JIRA Issue | HADOOP-16785 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux eb4d151346fc 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 768ee22 |
   | Default Java | 1.8.0_232 |
   | checkstyle | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/4/artifact/out/diff-checkstyle-root.txt |
   | unit | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/4/artifact/out/patch-unit-hadoop-common-project_hadoop-common.txt |
   |  Test Results | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/4/testReport/ |
   | Max. process+thread count | 1344 (vs. ulimit of 5500) |
   | modules | C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-azure U: . |
   | Console output | https://builds.apache.org/job/hadoop-multibranch/job/PR-1791/4/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.11.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] ThomasMarquardt commented on a change in pull request #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
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_r363405980
 
 

 ##########
 File path: hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/NativeAzureFileSystem.java
 ##########
 @@ -1198,6 +1201,17 @@ public void setEncodedKey(String anEncodedKey) {
     private void restoreKey() throws IOException {
       store.rename(getEncodedKey(), getKey());
     }
+
+    /**
+     * Check for the stream being open.
+     * @throws IOException if the stream is closed.
+     */
+    private void checkOpen() throws IOException {
 
 Review comment:
   Also, a similar issue exists for NativeAzureFsInputStream.  I should add that I'm inclined not to fix this stuff, the reason being that it has been like this for a long time, I'm not aware of any related customer support issues, and there is risk in any change.  With that said, I will +1 the changes if the risk is low--you are fixing valid issues and thank you for that!

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


[GitHub] [hadoop] steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream

Posted by GitBox <gi...@apache.org>.
steveloughran commented on issue #1791: HADOOP-16785: wasb to raise IOE if write() invoked on a closed stream
URL: https://github.com/apache/hadoop/pull/1791#issuecomment-571193435
 
 
   tested -azure wales. All good except for HADOOP-16706 and org.apache.hadoop.fs.azurebfs.ITestClientUrlScheme

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org