baryluk commented on a change in pull request #17649:
URL: https://github.com/apache/airflow/pull/17649#discussion_r700002154



##########
File path: airflow/providers/cncf/kubernetes/utils/pod_launcher.py
##########
@@ -244,7 +254,9 @@ def read_pod_logs(
                 **additional_kwargs,
             )
         except BaseHTTPError as e:
-            raise AirflowException(f'There was an error reading the kubernetes 
API: {e}')
+            self.log.warning(f'There was an error reading the kubernetes API: 
{e}')
+            # Reraise to be catched by self.monitor_pod.
+            raise

Review comment:
       Ok about `self.log.exception`.
   
   But what about `raise`? I think it is still needed. This is so tanacity can 
do raise too, and be proper exception be catched in `monitor_pod`

##########
File path: airflow/providers/cncf/kubernetes/utils/pod_launcher.py
##########
@@ -244,7 +254,9 @@ def read_pod_logs(
                 **additional_kwargs,
             )
         except BaseHTTPError as e:
-            raise AirflowException(f'There was an error reading the kubernetes 
API: {e}')
+            self.log.warning(f'There was an error reading the kubernetes API: 
{e}')
+            # Reraise to be catched by self.monitor_pod.
+            raise

Review comment:
       Ok about `self.log.exception`probably. It logs with level `ERROR`. Where 
I think warning is also ok.
   
   But what about `raise`? I think it is still needed. This is so tanacity can 
do raise too, and be proper exception be catched in `monitor_pod`




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


Reply via email to