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/05/08 07:41:37 UTC

[GitHub] [airflow] ashb commented on a change in pull request #8734: Added optional logging for pod container statuses once a pod fails. T…

ashb commented on a change in pull request #8734:
URL: https://github.com/apache/airflow/pull/8734#discussion_r421989967



##########
File path: airflow/kubernetes/pod_launcher.py
##########
@@ -183,6 +183,23 @@ def read_pod_logs(self, pod: V1Pod, tail_lines: int = 10):
                 'There was an error reading the kubernetes API: {}'.format(e)
             )
 
+    @tenacity.retry(
+        stop=tenacity.stop_after_attempt(3),
+        wait=tenacity.wait_exponential(),
+        reraise=True
+    )
+    def read_pod_status(self, pod):
+        """Reads statuses from the POD"""
+        try:
+            return self._client.read_namespaced_pod_status(
+                namespace=pod.metadata.namespace,
+                name=pod.metadata.name
+            )
+        except BaseHTTPError as e:
+            raise AirflowException(

Review comment:
       We don't need to catch and rethrow this as an AirflowException. So, let's remove the try/except here

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -177,6 +181,7 @@ def __init__(self,  # pylint: disable=too-many-arguments,too-many-locals
                  full_pod_spec: Optional[k8s.V1Pod] = None,
                  init_containers: Optional[List[k8s.V1Container]] = None,
                  log_events_on_failure: bool = False,
+                 log_container_statuses_on_failure: bool = False,

Review comment:
       wouldn't True be more useful a default (and for log events too)




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