Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connectors-ci: add retry logic at step level #26888

Merged
merged 7 commits into from
Jun 2, 2023

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Jun 1, 2023

What

Some Step might require a retry logic due to transient failures.
E.G: the connector package install transiently fail due to some pip errors related to not found packages.

How

  • The Step abstract class has a retry attribute set to false by default and a max_retries attribute set to 3 by default
  • If a retry is enable on a child class, when the _run call returns a failed step results _run is retried from within run

@alafanechere alafanechere marked this pull request as ready for review June 1, 2023 07:58
@alafanechere alafanechere requested a review from bnchrch June 1, 2023 07:58
Copy link
Contributor

@bnchrch bnchrch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, will approve to unblock :)

@@ -92,9 +93,12 @@ class Step(ABC):

title: ClassVar[str]
started_at: ClassVar[datetime]
retry: ClassVar[bool] = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove the retry boolean and intead rely on max_retries solely

max_retries: ClassVar[int] = 0
class ConnectorPackageInstall(Step):
    max_retries = 3

@alafanechere alafanechere enabled auto-merge (squash) June 1, 2023 21:52
@alafanechere alafanechere merged commit 5aeb956 into master Jun 2, 2023
18 checks passed
@alafanechere alafanechere deleted the augustin/connectors-ci/add-retry-logic branch June 2, 2023 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants