-
Notifications
You must be signed in to change notification settings - Fork 185
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
[BUG] Blocking behavior in AWSV4SignerAsyncAuth #410
Comments
Ouch. Regardless of the fix we do, do you think you can write a test that reproduces this kind of behavior? I would go with aiobotocore to delegate this kind of problems, I don't see downsides. |
Sure, I can take a look this weekend |
@dacevedo12 Any interest of picking this up again? |
In 2.4.0 we've added support for Urllib3 Sigv4 (it's now the default). Does that implementation have the same problem @dacevedo12? |
One could say this is mitigated by #470 as it defaults to using frozen credentials, which won't be refreshed by boto under the hood. However, if it goes through the other branch with credentials that (for some unknown reason) don't have a Refreshing credentials is usually a very quick network call to AWS STS so in most cases it's not concerning, but in scenarios like the one AWS experienced when I originally reported this issue, there will be retries with exponential backoff (using time.sleep) and that for sure will be blocking. |
hello, maintainer of aiobotocore here, yes this should support the async version of AioSession.get_credentials. So in this case swapping to |
Thanks for jumping in @thehesiod! Appreciate if someone on this thread could PR something here. |
made a draft here: #834 |
What is the bug?
Yesterday's AWS us-east-1 outage revealed that botocore talks to STS using
requests
, and retries them using a backoff withtime.sleep
, which are both blocking functions and will cause performance degradation as they hold the event-loop hostage.In this line:
sig_v4_auth.add_auth(aws_request)
https://github.com/opensearch-project/opensearch-py/blob/main/opensearchpy/helpers/asyncsigner.py#L54How can one reproduce the bug?
Try calling a search operation using AWSV4SignerAsyncAuth while simulating poor network conditions to trigger the retry with backoff mechanism in botocore
What is the expected behavior?
It should not block the event-loop
What is your host/environment?
Not relevant
Do you have any screenshots?
Do you have any additional context?
Three possible solution proposals:
sig_v4_auth.add_auth(aws_request)
call in a thread pool executorThe text was updated successfully, but these errors were encountered: