You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Taragolis (via GitHub)" <gi...@apache.org> on 2023/09/26 15:53:03 UTC

[GitHub] [airflow] Taragolis commented on a diff in pull request #34627: Error handling for when Azure container log cannot be read in properly.

Taragolis commented on code in PR #34627:
URL: https://github.com/apache/airflow/pull/34627#discussion_r1337441205


##########
airflow/providers/microsoft/azure/operators/container_instances.py:
##########
@@ -319,6 +319,9 @@ def _monitor_logging(self, resource_group: str, name: str) -> int:
                 if state in ["Running", "Terminated", "Succeeded"]:
                     try:
                         logs = self._ci_hook.get_logs(resource_group, name)
+                        if logs is None:
+                            self.log.exception("Container log is broken, marking as failed.")

Review Comment:
   I'm not familiar with Azure Container, so I'm not sure is unable to get logs should be a reason for mark task failed?
   
   
   If so, then we should replace `exception` to `error`, they have the same severity the difference is attach or not stack trace to the log 
   ```suggestion
                               self.log.error("Container log is broken, marking as failed.")
   ```
   
   I'm not sure is un



##########
airflow/providers/microsoft/azure/operators/container_instances.py:
##########
@@ -319,6 +319,9 @@ def _monitor_logging(self, resource_group: str, name: str) -> int:
                 if state in ["Running", "Terminated", "Succeeded"]:
                     try:
                         logs = self._ci_hook.get_logs(resource_group, name)
+                        if logs is None:
+                            self.log.exception("Container log is broken, marking as failed.")

Review Comment:
   I'm not familiar with Azure Container, so I'm not sure is unable to get logs should be a reason for mark task failed?
   
   
   If so, then we should replace `exception` to `error`, they have the same severity the difference is attach or not stack trace to the log 
   ```suggestion
                               self.log.error("Container log is broken, marking as failed.")
   ```
   



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org