codenamestif commented on a change in pull request #18733:
URL: https://github.com/apache/airflow/pull/18733#discussion_r722518049



##########
File path: airflow/providers/amazon/aws/operators/ecs.py
##########
@@ -452,6 +460,11 @@ def _check_success_task(self) -> None:
         if len(response.get('failures', [])) > 0:
             raise AirflowException(response)
 
+        if self.task_log_fetcher and not 
self.task_log_fetcher.is_log_stream_created():
+            raise AirflowException(
+                'Cloudwatch log stream for the task is not found. The task 
probably failed to start.'
+            )
+
         for task in response['tasks']:

Review comment:
       ```suggestion
           for task in response['tasks']:
               if task.get('stopCode', '') == 'TaskFailedToStart':
                   raise AirflowException('The task failed to start.')
   ```
   
   Such check is probably better and simpler. And no need to check cloudwatch 
log streams.




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