[ 
https://issues.apache.org/jira/browse/HADOOP-19393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17916611#comment-17916611
 ] 

ASF GitHub Bot commented on HADOOP-19393:
-----------------------------------------

anujmodi2021 commented on code in PR #7312:
URL: https://github.com/apache/hadoop/pull/7312#discussion_r1928159588


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemDelegationSAS.java:
##########
@@ -213,6 +214,24 @@ public void testReadAndWrite() throws Exception {
     }
   }
 
+  @Test
+  public void checkExceptionForRenameOverwrites() throws Exception {
+    final AzureBlobFileSystem fs = getFileSystem();
+
+    Path src = new Path("a/b/f1.txt");
+    Path dest = new Path("a/b/f2.txt");
+    touch(src);
+    touch(dest);
+
+    try {
+      fs.rename(src, dest);
+      Assertions.fail("Exception expected on rename overwrites.");
+    } catch (FileAlreadyExistsException e) {
+      Assertions.assertThat(e)

Review Comment:
   Nit: add a description for assert failures here and anywhere else you are 
using Assertions. Something like this.
   `Assertions.assertThat(e).describedAs("FileAlreadyExistsException was 
expected").isInstaceOf();`





> ABFS: Returning FileAlreadyExists Exception for UnauthorizedBlobOverwrite 
> Rename Errors
> ---------------------------------------------------------------------------------------
>
>                 Key: HADOOP-19393
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19393
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/azure
>    Affects Versions: 3.4.0, 3.4.1
>            Reporter: Manika Joshi
>            Assignee: Manika Joshi
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.5.0, 3.4.2
>
>
> ABFS driver adheres to Hadoop's expectations which does not allow rename blob 
> overwrites. Recently we came across the case where UnauthorizedBlobOverwrite 
> error (HTTP 403- Access Denied Exception) is thrown for rename overwrites 
> (with SAS authentication).
> Remapping this error to FileAlreadyExists exception for better understanding.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to