vincbeck commented on code in PR #64770:
URL: https://github.com/apache/airflow/pull/64770#discussion_r3074900854


##########
providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -604,10 +610,19 @@ def check_failure(self, query_status):
     def execute_complete(self, context: Context, event: dict[str, Any] | None 
= None) -> str:
         validated_event = validate_execute_complete_event(event)
 
-        if validated_event["status"] != "success":
-            raise AirflowException(f"Error while running job: 
{validated_event}")
-
-        return validated_event["job_id"]
+        if validated_event["status"] == "success":
+            return validated_event["job_id"]
+        job_id = validated_event.get("job_id")
+        if job_id:
+            self.log.info("Cancelling EMR container job %s", job_id)
+            try:
+                self.hook.stop_query(job_id)

Review Comment:
   You seem to cancel the job regardless of `cancel_on_kill` value?



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