Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Add tenacity retries to run method #121

Merged
merged 5 commits into from
Mar 11, 2024
Merged

Add tenacity retries to run method #121

merged 5 commits into from
Mar 11, 2024

Conversation

gabcoyne
Copy link
Contributor

@gabcoyne gabcoyne commented Mar 8, 2024

In order to support a greater degree of resiliency in job creation we're adding tenacity to preserve existing signatures and provide retry functionality.

Closes #116

Example

@retry(
    stop=stop_after_attempt(MAX_ATTEMPTS),
    wait=wait_fixed(RETRY_MIN_DELAY_SECONDS)
    + wait_random(
        RETRY_MIN_DELAY_JITTER_SECONDS,
        RETRY_MAX_DELAY_JITTER_SECONDS,
    ),
    reraise=True,
)

Screenshots

Checklist

  • [x ] References any related issue by including "Closes #" or "Closes ".
    • If no issue exists and your change is not a small fix, please create an issue first.
  • Includes tests or only affects documentation.
  • Passes pre-commit checks.
    • Run pre-commit install && pre-commit run --all locally for formatting and linting.
  • Includes screenshots of documentation updates.
    • Run mkdocs serve view documentation locally.

@gabcoyne gabcoyne requested a review from a team as a code owner March 8, 2024 23:42
@desertaxle desertaxle merged commit 6e2024b into main Mar 11, 2024
6 checks passed
@zzstoatzz zzstoatzz deleted the feature/run-retries branch March 11, 2024 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add resiliency to requests to k8s API in kubernetes worker
2 participants