Skip to content

Commit 052e196

Browse files
committed
EXPERIMENT: apacheGH-44071: [C++] Leak S3 structures if finalization happens too late
1 parent a828bd2 commit 052e196

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cpp/src/arrow/filesystem/s3fs.cc

+3
Original file line numberDiff line numberDiff line change
@@ -3389,6 +3389,9 @@ struct AwsInstance {
33893389
ARROW_LOG(WARNING)
33903390
<< " arrow::fs::FinalizeS3 was not called even though S3 was initialized. "
33913391
"This could lead to a segmentation fault at exit";
3392+
auto leaked_ptr = new std::shared_ptr<S3ClientFinalizer>(GetClientFinalizer());
3393+
ARROW_UNUSED(leaked_ptr);
3394+
return;
33923395
}
33933396
GetClientFinalizer()->Finalize();
33943397
#ifdef ARROW_S3_HAS_S3CLIENT_CONFIGURATION

0 commit comments

Comments
 (0)