glindstr opened a new issue, #39184:
URL: https://github.com/apache/arrow/issues/39184
### Describe the bug, including details regarding any error messages,
version, and platform.
There appears to be a bug slowing down the creation of a S3FileSystem object
when supplying a AWS_PROFILE via environment variable but if that profile
doesn't have a corresponding .aws/config entry it hangs. I'm using python but
the problematic code may be in the underlining c/c++ library.
.aws/credentials
```
[profile_name_with_config]
aws_access_key_id = ...
aws_secret_access_key = ...
[profile_name_without_config]
aws_access_key_id = ...
aws_secret_access_key = ...
```
.aws/config
```
[profile profile_name_with_config]
region = us-west-2
output = json
```
fresh python 3.12.1 environment
```
numpy 1.26.2
pip 23.2.1
pyarrow 14.0.1
```
test code
```python
from pyarrow.fs import S3FileSystem
import time as t
import os
os.environ["AWS_PROFILE"] = "profile_name_with_config"
tic = t.perf_counter()
fs = S3FileSystem()
toc = t.perf_counter()
print(f"S3FileSystem where config exists {toc - tic:0.4f} seconds")
#S3FileSystem where config exists 0.0071 seconds
os.environ["AWS_PROFILE"] = "profile_name_without_config"
tic = t.perf_counter()
fs = S3FileSystem()
toc = t.perf_counter()
print(f"S3FileSystem where config does not exist {toc - tic:0.4f} seconds")
#S3FileSystem where config does not exist 24.0123 seconds
```
It takes S3FileSystem 24 additional seconds to complete when no config entry
is provided. A pretty surprising result.
Thank you for reviewing.
### Component(s)
C++, Python
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]