This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c6227a900 [fix](filesystem) Fix core caused by using moved variable 
in batch_delete_impl #20033
3c6227a900 is described below

commit 3c6227a9004fa81153a6a05408d3633d1f246b52
Author: plat1ko <platonekos...@gmail.com>
AuthorDate: Fri May 26 21:39:27 2023 +0800

    [fix](filesystem) Fix core caused by using moved variable in 
batch_delete_impl #20033
---
 be/src/io/fs/s3_file_system.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/be/src/io/fs/s3_file_system.cpp b/be/src/io/fs/s3_file_system.cpp
index c7efcc414a..51cd474238 100644
--- a/be/src/io/fs/s3_file_system.cpp
+++ b/be/src/io/fs/s3_file_system.cpp
@@ -244,8 +244,10 @@ Status S3FileSystem::batch_delete_impl(const 
std::vector<Path>& remote_files) {
         delete_request.SetDelete(std::move(del));
         auto delete_outcome = client->DeleteObjects(delete_request);
         if (UNLIKELY(!delete_outcome.IsSuccess())) {
-            return Status::IOError("failed to delete objects: {}",
-                                   error_msg(objects.front().GetKey(), 
delete_outcome));
+            return Status::IOError(
+                    "failed to delete objects: {}",
+                    
error_msg(delete_request.GetDelete().GetObjects().front().GetKey(),
+                              delete_outcome));
         }
         if (UNLIKELY(!delete_outcome.GetResult().GetErrors().empty())) {
             const auto& e = delete_outcome.GetResult().GetErrors().front();
@@ -406,8 +408,9 @@ Status S3FileSystem::batch_upload_impl(const 
std::vector<Path>& local_files,
         handle->WaitUntilFinished();
         if (handle->GetStatus() != Aws::Transfer::TransferStatus::COMPLETED) {
             // TODO(cyx): Maybe we can cancel remaining handles.
-            return Status::IOError("failed to upload: {}",
-                                   error_msg("", 
handle->GetLastError().GetMessage()));
+            return Status::IOError(
+                    "failed to upload: {}",
+                    error_msg(handle->GetKey(), 
handle->GetLastError().GetMessage()));
         }
     }
     return Status::OK();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to