Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Avoid double initialisation / double finalize of Aws SDK #40262

Open
TechnophobicLampshade opened this issue Feb 27, 2024 · 5 comments
Open
Labels
Component: C++ Type: usage Issue is a user question

Comments

@TechnophobicLampshade
Copy link

Describe the usage question you have. Please include as many useful details as possible.

I have pre-existing code that uses the C++ AWS SDK and calls Aws::InitAPI and Aws::ShutdownAPI. Now I am using arrow with s3, and it seems to need me to call arrow's arrow::fs::InitializeS3() before it will allow me to use the S3FileSystem. I would prefer to handle SDK initialisation myself, but I don't see a way to tell arrow that "I've already initialised the SDK, don't do it yourself". I would prefer not to add Arrow awareness to all of my existing code.

Is there a known workaround for this please?

Component(s)

C++

@TechnophobicLampshade TechnophobicLampshade added the Type: usage Issue is a user question label Feb 27, 2024
@pitrou pitrou changed the title Avoid double initialisation / double finalize of Aws SDK [C++] Avoid double initialisation / double finalize of Aws SDK Feb 27, 2024
@pitrou
Copy link
Member

pitrou commented Feb 27, 2024

Is there a known workaround for this please?

Currently, no, but that's a reasonable feature request. Perhaps by adding APIs such as:

void MarkS3Initialized();
void MarkS3Finalized();

What do you think?

@TechnophobicLampshade
Copy link
Author

Thanks @pitrou. That API makes sense to me.

@TechnophobicLampshade
Copy link
Author

It seems that in more recent versions of the aws sdk than I was using, there is code that ignores duplicate Init/Shutdown calls:
https://github.com/aws/aws-sdk-cpp/blob/5929e202e9b1cd84d6234aa01b64f56fd2208350/src/aws-cpp-sdk-core/source/Aws.cpp#L188

Perhaps this avoids the need for this altogether.

@pitrou
Copy link
Member

pitrou commented Feb 27, 2024

Perhaps this avoids the need for this altogether.

Can you take a look and see whether it's good enough for you?

@johnkerl
Copy link

We have tested wheels with the referenced AWS SDK patch, in 16.0 and 17.0-rc wheels (see #42154), and we believe this issue still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: C++ Type: usage Issue is a user question
Projects
None yet
Development

No branches or pull requests

3 participants