Skip to content

Commit

Permalink
[AIRFLOW-6040] ReadTimoutError should not raise exception (#7616)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimberman authored and kaxil committed Mar 19, 2020
1 parent f42c867 commit 30ed697
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion airflow/contrib/executors/kubernetes_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
import json
import multiprocessing
from uuid import uuid4
import time

from dateutil import parser

import kubernetes
from kubernetes import watch, client
from kubernetes.client.rest import ApiException
from urllib3.exceptions import HTTPError
from urllib3.exceptions import HTTPError, ReadTimeoutError

from airflow.configuration import conf
from airflow.contrib.kubernetes.pod_launcher import PodLauncher
Expand Down Expand Up @@ -338,6 +339,10 @@ def run(self):
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

0 comments on commit 30ed697

Please sign in to comment.