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/12/16 11:34:54 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6643: [AIRFLOW-6040] Fix KubernetesJobWatcher Read time out error

ashb commented on a change in pull request #6643: [AIRFLOW-6040] Fix KubernetesJobWatcher Read time out error
URL: https://github.com/apache/airflow/pull/6643#discussion_r358185786
 
 

 ##########
 File path: airflow/executors/kubernetes_executor.py
 ##########
 @@ -315,6 +308,21 @@ def _run(self,
 
         return last_resource_version
 
+    def _get_watcher_args(self,
+                          resource_version: Optional[str],
+                          worker_uuid: str,
+                          kube_config: Any) -> dict:
+        """Builds and returns the kwargs necessary for Watcher"""
+        kwargs = {'label_selector': 'airflow-worker={}'.format(worker_uuid)}
+        if resource_version:
+            kwargs['resource_version'] = resource_version
+        if kube_config.kube_client_request_args:
+            for key, value in kube_config.kube_client_request_args.iteritems():
+                kwargs[key] = value
+            conn_timeout = kube_config.kube_client_request_args.get('_request_timeout', [60, 60])[0]
+            kwargs['timeout_seconds'] = conn_timeout - 1 if conn_timeout - 1 > 0 else 1
 
 Review comment:
   ```suggestion
               kwargs['timeout_seconds'] = max(conn_timeout - 1, 1)
   ```
   
   (Assuming they are integers.)

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