You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pitrou (via GitHub)" <gi...@apache.org> on 2023/07/03 11:44:25 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #36437: GH-36346: [C++][S3] Shutdown aws-sdk-cpp related resources on finalize

pitrou commented on code in PR #36437:
URL: https://github.com/apache/arrow/pull/36437#discussion_r1250758134


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -398,12 +398,19 @@ namespace {
 Status CheckS3Initialized() {
   if (!IsS3Initialized()) {
     return Status::Invalid(
-        "S3 subsystem not initialized; please call InitializeS3() "
+        "S3 subsystem is not initialized; please call InitializeS3() "
         "before carrying out any S3-related operation");
   }
   return Status::OK();
 }
 
+Status CheckS3Finalized() {

Review Comment:
   In any case, please call this `CheckS3NotFinalized` as the current name is misleading.



##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -398,12 +398,19 @@ namespace {
 Status CheckS3Initialized() {
   if (!IsS3Initialized()) {
     return Status::Invalid(
-        "S3 subsystem not initialized; please call InitializeS3() "
+        "S3 subsystem is not initialized; please call InitializeS3() "
         "before carrying out any S3-related operation");
   }
   return Status::OK();
 }
 
+Status CheckS3Finalized() {

Review Comment:
   Is this actually useful? `is_initialized_` is set to false when finalizing, so `CheckS3Initialized` will already fail.



##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -2562,6 +2626,8 @@ Result<std::shared_ptr<io::OutputStream>> S3FileSystem::OpenOutputStream(
   ARROW_ASSIGN_OR_RAISE(auto path, S3Path::FromString(s));
   RETURN_NOT_OK(ValidateFilePath(path));
 
+  RETURN_NOT_OK(CheckS3Finalized());

Review Comment:
   Can you put this consistently at the start of the method?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org