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 2019/08/08 04:20:56 UTC

[GitHub] [hadoop] jojochuang commented on a change in pull request #1223: HADOOP-16112. Delete the baseTrashPath's subDir leads to don't modify baseTrashPath

jojochuang commented on a change in pull request #1223: HADOOP-16112. Delete the baseTrashPath's subDir leads to don't modify baseTrashPath
URL: https://github.com/apache/hadoop/pull/1223#discussion_r311849596
 
 

 ##########
 File path: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestTrash.java
 ##########
 @@ -627,6 +630,34 @@ public void testExistingFileTrash() throws IOException {
           e.getLocalizedMessage());
     }
     assertTrue(val2 == 0);
+
+    // Third rm a file which parent path is the same as above.
+    // Make baseTrashPath, at the same time delete existTrashPath
+    mkdir(fs, myFile);
+    writeFile(fs, new Path(myFile, "mySubFile2"), 10);
+    String[] args3 = new String[2];
+    args3[0] = "-rm";
+    args3[1] = new Path(myFile, "mySubFile2").toString();
+    int val3 = -1;
+    new Thread(new Runnable() {
+      @Override
+      public void run() {
+        try {
+          Thread.sleep(2000);
+          fs.delete(new Path(fs.getHomeDirectory() + "/.Trash/Current" + myFile), true);
+        } catch (IOException e) {
+        } catch (InterruptedException e) {
 
 Review comment:
   catch (IOException | InterruptedException e)

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