syedahsn commented on code in PR #30244:
URL: https://github.com/apache/airflow/pull/30244#discussion_r1148170384


##########
airflow/providers/amazon/aws/triggers/redshift_cluster.py:
##########
@@ -70,6 +76,18 @@ async def run(self) -> AsyncIterator["TriggerEvent"]:
                     else:
                         if self.attempts < 1:
                             yield TriggerEvent({"status": "error", "message": 
f"{self.task_id} failed"})
+                elif self.operation_type == "delete_cluster":
+                    response = await hook.delete_cluster(

Review Comment:
   The parameter `attempts` is not being checked here, and is ignored inside 
`delete_cluster`, which runs until an error or the expected state is reached. 
One problem with this is that line 94 checks the `attempts` parameter before 
yielding a `TriggerEvent`. If an exception is thrown at any point inside this 
operation, it will be caught, then ignored because `self.attempts` will not 
have changed.



-- 
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]

Reply via email to