-
Notifications
You must be signed in to change notification settings - Fork 1.5k
With a lot of concurrent requests to metadata service, credentials can fail #448
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
Conversation
…n fail. To fix that: - add a lock so the metadata service isnt flooded with requests. - add process.nextTick so IO can still be processed even with a lot of request to the metadata service being generated + will work in browser with browserify.
…n fail. To fix that: - add a lock so the metadata service isnt flooded with requests. - add setImmediate so IO can still be processed even with a lot of request to the metadata service being generated.
@lsegal I think this is all set to go, unless there is anything else you think is blocking. Thanks! |
Add lock around AWS.MetadataService.loadCredentials()
Looks good, thanks! |
@lsegal great! Just curious, what does the release / publish cycle for aws-sdk look like? I'd like to be able to use this from npm. |
We have a release scheduled this week. FWIW you can use this from npm already if you |
I have a number of node modules that are running as cron jobs. The modules use the aws-sdk for javascript (Installed using
This occurs randomly for all the modules. After the error, it again works fine for some time with another occurence of the error. Please help. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
This is encountered as
CredentialsError: Missing credentials in config
because the request for IAM Role can timeout before all the requests are answered. fixes #445The fix:
This is a bit hard to add a test for. I did add a test for multiple concurrent requests to
loadCredentials
.On an ec2 of the same type and size: This test case passed with these changes, even with increasing concurrency up to 10000.
cc: @lsegal @willwhite