westonpace commented on issue #35876: URL: https://github.com/apache/arrow/issues/35876#issuecomment-1589658833
> I looked at the arrow code, and it is not clear to me where this should happen. As I said, you must call it once before your application exits. > Putting the call before the connection is severed did not fix the problem. I'm sorry. I don't understand what this means. For example, this is valid: ``` int main() { if (!arrow::fs::EnsureS3Initialized().ok()) { std::cerr << "Failed to initialize S3" << std::endl; return 1; } // Your program goes here... if (!arrow::fs::EnsureS3Finalized().ok()) { std::cerr << "Failed to finalize S3" << std::endl; return 1; } return 0; } ``` This is not valid: ``` struct GlobalS3Filesystem { GlobalS3Filesystem() { if (!arrow::fs::EnsureS3Initialized().ok()) { // handle error return; } arrow::Result<std::shared_ptr<arrow::fs::S3FileSystem>> maybe_s3fs = arrow::fs::S3FileSystem::Make({}); if (!maybe_s3fs.ok()) { // handle error return; } s3fs = maybe_s3fs.MoveValueUnsafe(); } ~GlobalS3Filesystem() { if (!arrow::fs::EnsureS3Finalized().ok()) { // handle error } } std::shared_ptr<arrow::fs::FileSystem> s3fs; }; std::shared_ptr<arrow::fs::FileSystem> GetGlobalS3Filesystem() { static GlobalS3Filesystem global_s3fs; return global_s3fs.s3fs; } ``` -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org