Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
[AIRFLOW-6040] ReadTimoutError should not raise exception (apache#7616)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimberman authored and galuszkak committed Mar 5, 2020
1 parent 6802275 commit 83fa999
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 83fa999

Please sign in to comment.