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 14:36:17 UTC

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

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



##########
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:
       @ashb It is the way all api calls are written in pod_launcher. All other api calls in methods "read_pod", "read_pod_logs", and "read_pod_events" are capturing and throwing AirflowExection. kubernetes_pod.py is also only capturing AirflowException so we have to capture and rethrow with current code structure I would say.




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