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


##########
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:
   Fortunately from a behaviour standpoint returning 1 does correctly delete 
the container group:
   ```
   [2023-09-27, 10:22:09 UTC] {container_instances.py:322} ERROR - Container 
log is broken. Marking as failed.
   [2023-09-27, 10:22:09 UTC] {container_instances.py:262} INFO - Container had 
exit code: 1
   [2023-09-27, 10:22:09 UTC] {container_instances.py:277} INFO - Deleting 
container group
   ```
   But yes since getting logs fails and gives a None you can't really get a 
Terminated or Failed state, the whole thing gets lost and starts reprovisioning 
the container unless something is done such as returning 1 to kill it.



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