kou commented on code in PR #41068:
URL: https://github.com/apache/arrow/pull/41068#discussion_r1558301639


##########
cpp/src/arrow/filesystem/azurefs.cc:
##########
@@ -2168,13 +2203,6 @@ class AzureFileSystem::Impl {
       // All the others either succeed or throw an exception.
       DCHECK(response.Value.Deleted);
     } catch (const Storage::StorageException& exception) {
-      if (exception.ErrorCode == "FilesystemNotFound" ||
-          exception.ErrorCode == "PathNotFound") {
-        if (require_dir_to_exist) {
-          return PathNotFound(location);
-        }
-        return Status::OK();
-      }

Review Comment:
   Can we block changing the target location from other connections by using 
`lease_id` for `GetFileInfo()` too? 
   
   ```diff
   diff --git a/cpp/src/arrow/filesystem/azurefs.cc 
b/cpp/src/arrow/filesystem/azurefs.cc
   index df6db3d959..67232b3156 100644
   --- a/cpp/src/arrow/filesystem/azurefs.cc
   +++ b/cpp/src/arrow/filesystem/azurefs.cc
   @@ -2181,7 +2181,7 @@ class AzureFileSystem::Impl {
                                   Azure::Nullable<std::string> lease_id = {}) {
        DCHECK(!location.container.empty());
        DCHECK(!location.path.empty());
   -    ARROW_ASSIGN_OR_RAISE(auto file_info, GetFileInfo(adlfs_client, 
location));
   +    ARROW_ASSIGN_OR_RAISE(auto file_info, GetFileInfo(adlfs_client, 
location, lease_id));
        if (file_info.type() == FileType::NotFound) {
          if (require_dir_to_exist) {
            return PathNotFound(location);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to