utkarsharma2 commented on code in PR #34627:
URL: https://github.com/apache/airflow/pull/34627#discussion_r1337259003
##########
airflow/providers/microsoft/azure/operators/container_instances.py:
##########
@@ -324,6 +324,9 @@ def _monitor_logging(self, resource_group: str, name: str)
-> int:
self.log.exception(
"Exception while getting logs from container
instance, retrying..."
)
+ except AttributeError:
+ self.log.exception("Container log is broken, marking
as failed.")
Review Comment:
@krisfur Thanks for raising the PR. :)
Would it make more sense to handle this at source instead?
https://github.com/apache/airflow/blob/d6db11e7634953579ca4737b20aa405f65869834/airflow/providers/microsoft/azure/hooks/container_instance.py#L180
Mainly because `AttributeError` is generic and this try/except can possibly
mishandle the exception it should not handle. Maybe we can check for the
`content` attribute to exist and return the logs or None and do logging based
on the return value in the `_monitor_logging` function WDYT?
--
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]