Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions airflow/executors/kubernetes_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import json
import multiprocessing
import re
import time
from queue import Empty, Queue # pylint: disable=unused-import
from typing import Any, Dict, Optional, Tuple, Union

Expand All @@ -29,6 +30,7 @@
from kubernetes import client, watch
from kubernetes.client import Configuration
from kubernetes.client.rest import ApiException
from urllib3.exceptions import ReadTimeoutError

from airflow import settings
from airflow.configuration import conf
Expand Down Expand Up @@ -289,6 +291,10 @@ def run(self) -> None:
try:
self.resource_version = self._run(kube_client, self.resource_version,
self.worker_uuid, self.kube_config)
except ReadTimeoutError:
self.log.warning("There was a timeout error accessing the Kube API. "
"Retrying request.", exc_info=True)
time.sleep(1)
except Exception:
self.log.exception('Unknown error in KubernetesJobWatcher. Failing')
raise
Expand Down