MCPcopy Create free account
hub / github.com/apache/arrow / EnsureS3InitializedWithSigpipeHandler

Function EnsureS3InitializedWithSigpipeHandler

r/src/filesystem.cpp:301–309  ·  view source on GitHub ↗

Initialize S3 with the SIGPIPE handler enabled. Without it, stale connections in the SDK's connection pool can trigger SIGPIPE during Aws::ShutdownAPI(), which causes R's signal handler to longjmp out of the teardown and segfault (GH-50009, GH-32026).

Source from the content-addressed store, hash-verified

299// which causes R's signal handler to longjmp out of the teardown and segfault
300// (GH-50009, GH-32026).
301void EnsureS3InitializedWithSigpipeHandler() {
302 fs::S3GlobalOptions options = fs::S3GlobalOptions::Defaults();
303 options.install_sigpipe_handler = true;
304 auto status = fs::InitializeS3(options);
305 // InitializeS3 returns Invalid if already initialized - that's fine
306 if (!status.ok() && !fs::IsS3Initialized()) {
307 StopIfNotOk(status);
308 }
309}
310
311// [[s3::export]]
312std::shared_ptr<fs::S3FileSystem> fs___S3FileSystem__create(

Callers 2

fs___FileSystemFromUriFunction · 0.85

Calls 5

InitializeS3Function · 0.85
IsS3InitializedFunction · 0.85
StopIfNotOkFunction · 0.85
DefaultsFunction · 0.50
okMethod · 0.45

Tested by

no test coverage detected