You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/09/08 04:08:30 UTC
[GitHub] [airflow] Adil-Ibragimov commented on a change in pull request #10315: Add retry_only_on_pod_launching_failure and log_container_statuses_on…
Adil-Ibragimov commented on a change in pull request #10315:
URL: https://github.com/apache/airflow/pull/10315#discussion_r484638836
##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -350,6 +359,19 @@ def _set_name(self, name):
validate_key(name, max_length=220)
return re.sub(r'[^a-z0-9.-]+', '-', name.lower())
+ def _log_pod_events_on_failure(self, pod, launcher):
+ if self.log_events_on_failure:
+ for event in launcher.read_pod_events(pod).items:
+ self.log.error("Pod Event: %s - %s", event.reason, event.message)
+
+ def _log_pod_status_on_failure(self, pod, launcher):
+ try:
+ pod_status = launcher.read_pod_status(pod)
+ self.log.error('Pod not succeeded, look for OOMKilled in containers statuses.')
+ self.log.error(pod_status.status.container_statuses)
+ except AirflowException as ex:
+ self.log.exception('Failed to get container statuses: %s', ex)
Review comment:
fixed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org