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

Blocking call when loading credentials in Session.create_client #2

Closed
mpaolini opened this issue Sep 14, 2015 · 7 comments
Closed

Blocking call when loading credentials in Session.create_client #2

mpaolini opened this issue Sep 14, 2015 · 7 comments

Comments

@mpaolini
Copy link

in aiobotocore.session.Session we make use of self.get_credentials that is implemented in botocore.session.Session.

This method's implementation depends on credential provider config, and in some cases it can block while doing IO, for instance when loading from ini file or when using a IAM role

@jettify
Copy link
Member

jettify commented Sep 14, 2015

Thanks for thre report! On my project we explicitly pass key and secret as keyword argumens, so I missed this issue.

I will take a look. Can we assume that credential loading happens only once? If so I think, spawning thread in order to read small file once is not worth effort.

@mpaolini
Copy link
Author

Yep only once, if it is OK for you I can cook a pach for this

@jettify
Copy link
Member

jettify commented Sep 14, 2015

Sure, please do.

@mpaolini
Copy link
Author

Which botocore version are you targeting? looks like the one in setup.py is a bit old. Lots of test fail...

@mpaolini
Copy link
Author

ok I found out . it is botocore<1.2 (they've changed the way the endpoint is created so it doesn't work on 1.2)

mpaolini pushed a commit to elastic-coders/aiobotocore that referenced this issue Sep 14, 2015
Some credentials providers do blocking IO. Wrap all of them
with a thread so we don't block the event loop.

See issue aio-libs#2
@jettify jettify added this to the First release to PyPI milestone Feb 1, 2016
jettify pushed a commit that referenced this issue Mar 10, 2016
@thehesiod
Copy link
Collaborator

hmm, I remember there being a comment that the credentials are periodically updated. I looked into this and it was not a trivial fix

@thehesiod
Copy link
Collaborator

closing in favor of #619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants