Refresh credentials in AwsEcsExecutor#36179
Conversation
Maybe it is some bug in refresh credentials into the BaseSessionFactory or either into the I've asked it because refresh credentials it is internals of the Credential Providers into the airflow/airflow/providers/amazon/aws/hooks/base_aws.py Lines 238 to 241 in 5f4d2b5 However if it failed into the ECS Executor then seems like it should failed also in regular usage |
airflow/providers/amazon/aws/utils/exponential_backoff_retry.py
Outdated
Show resolved
Hide resolved
AwsEcsExecutor
airflow/providers/amazon/aws/utils/exponential_backoff_retry.py
Outdated
Show resolved
Hide resolved
airflow/providers/amazon/aws/utils/exponential_backoff_retry.py
Outdated
Show resolved
Hide resolved
eladkal
left a comment
There was a problem hiding this comment.
My 2 comments are just thoughts/observations.
LGTM in any case so feel free to move forward
Add an exponential backoff on the retry mechanism so that API calls aren't unnecessarily made Add unit tests for exponential back off function
16fb263 to
0632fdd
Compare
8a545cb to
6f2d6f9
Compare
Currently, credentials are loaded once at the initialization of the ECS Executor, and those credentials are used to authenticate to the ECS API. If those credentials expire, the Executor will not able to schedule new tasks, or update existing ones. There is no way to reload the credentials except by restarting the scheduler.
The purpose of this PR is to allow the Executor to refresh its credentials if they expire. It includes an exponential backoff retry method that retries the credentials based on the previous attempt so that the API has a chance to work through any transient issues, and to not unnecessarily spam the API if the credentials are genuinely expired.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.