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 2019/09/30 09:59:26 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6212: [AIRFLOW-5571] Fix bug that kubernetes getting log error will stop pod unexpectedly

ashb commented on a change in pull request #6212: [AIRFLOW-5571] Fix bug that kubernetes getting log error will stop pod unexpectedly
URL: https://github.com/apache/airflow/pull/6212#discussion_r329498566
 
 

 ##########
 File path: airflow/kubernetes/pod_launcher.py
 ##########
 @@ -123,8 +124,13 @@ def run_pod(
     def _monitor_pod(self, pod: V1Pod, get_logs: bool) -> Tuple[State, Optional[str]]:
         if get_logs:
             logs = self.read_pod_logs(pod)
-            for line in logs:
-                self.log.info(line)
+            # Catch exception as for loop on HttpResponse may corrupt.
+            try:
+                for line in logs:
+                    self.log.info(line)
+            except ProtocolError as e:
 
 Review comment:
   I guess this is better than nothing (and better than failing) but would it be possible to provide the `timestamps=True` (which we filter back out again) and use `since_time` to start-off again where we left off.

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


With regards,
Apache Git Services