generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 209
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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 with time.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#L54
How 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:
- Use aiobotocore, as it already takes care of that https://github.com/aio-libs/aiobotocore/blob/master/aiobotocore/signers.py
- Document a heads-up warning to use only frozen (read-only) credentials with AWSV4SignerAsyncAuth to prevent this blocking refresh operation
- Run the
sig_v4_auth.add_auth(aws_request)
call in a thread pool executor
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working