pankajkoti commented on code in PR #31215:
URL: https://github.com/apache/airflow/pull/31215#discussion_r1191333952
##########
airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -102,10 +104,22 @@ def __init__(
self.waiter_max_attempts = waiter_max_attempts
self.execution_role_arn = execution_role_arn
- def execute(self, context: Context) -> list[str]:
- emr_hook = EmrHook(aws_conn_id=self.aws_conn_id)
+ @cached_property
+ def hook(self) -> EmrHook:
+ """Create and return an EmrHook."""
+ # Increase the number of max attempts (default 5) because the
AddJobFlowSteps API gets throttled,
+ # replenishment is quite slow.
+ # See https://docs.aws.amazon.com/general/latest/gr/emr.html#limits_emr
+ config = Config(
+ retries={
+ "max_attempts": 10,
Review Comment:
Should we expose this and accept as a parameter? If we observe that 10 is
not enough too, the only way to control this would be via a code change.
Or do we see any downside in exposing this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]