From 3177e527a93e4a386ebc5d4bd43906fa832737d7 Mon Sep 17 00:00:00 2001 From: insomnes Date: Thu, 9 Jan 2025 21:37:08 +0100 Subject: [PATCH] Fix watcher kube_client_request_args shadowing --- .../kubernetes/executors/kubernetes_executor_utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/providers/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py b/providers/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py index ad0207cdfa3b3..5c50ed8bc5924 100644 --- a/providers/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py +++ b/providers/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor_utils.py @@ -147,10 +147,12 @@ def _run( # For info about k8s timeout settings see # https://github.com/kubernetes-client/python/blob/v29.0.0/examples/watch/timeout-settings.md # and https://github.com/kubernetes-client/python/blob/v29.0.0/kubernetes/client/api_client.py#L336-L339 - client_timeout = 30 - server_conn_timeout = 3600 - kwargs["_request_timeout"] = client_timeout - kwargs["timeout_seconds"] = server_conn_timeout + if "_request_timeout" not in kwargs: + client_timeout = 30 + kwargs["_request_timeout"] = client_timeout + if "timeout_seconds" not in kwargs: + server_conn_timeout = 3600 + kwargs["timeout_seconds"] = server_conn_timeout logical_date_key = get_logical_date_key() for event in self._pod_events(kube_client=kube_client, query_kwargs=kwargs):