Skip to content

Commit

Permalink
Use exponential backoff when getting the workflow status. (kubeflow#170)
Browse files Browse the repository at this point in the history
* We were using a fixed retry window that was too short O(5 seconds).
* Use exponential backoff and retry for up to 3 minutes. We are seeing
  test flakes due to problems getting the workflow status.

* Related to kubeflow#169
  • Loading branch information
jlewi authored and k8s-ci-robot committed Jul 6, 2018
1 parent 2f9a392 commit f7c7645
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion py/kubeflow/testing/argo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def log_status(workflow):
logging.exception('KeyError: %s', e)


@retry(stop_max_attempt_number=3, wait_fixed=2000,
# Wait 2^x * 1 second between retries up to a max of 10 seconds between
# retries.
# Retry for a maximum of 3 minutes.
@retry(wait_exponential_multiplier=1000, wait_exponential_max=10000,
stop_max_delay=3*60*1000,
retry_on_exception=lambda e: not isinstance(e, util.TimeoutError))
def wait_for_workflows(client, namespace, names,
timeout=datetime.timedelta(minutes=30),
Expand Down

0 comments on commit f7c7645

Please sign in to comment.