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

Track task run count via Retry states #281

Merged
merged 2 commits into from
Oct 17, 2018
Merged

Track task run count via Retry states #281

merged 2 commits into from
Oct 17, 2018

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Oct 16, 2018

Previously, the run count had to be provided manually by adding it to the run's context.

This PR modifies the Retrying state to carry a run_count attribute. When a TaskRunner runs, the first thing it does is check if the initial task state is a Retrying state and, if so, if it indicates the last run number. If it does, the context is updated with one more than that value; otherwise, the context's run count is set to 1.

Any time a Retry state is created, if no run_count is provided it attempts to read it out of context. This way, user-generated Retry states (and signals) track the correct run count.

@jlowin jlowin requested a review from cicdw as a code owner October 16, 2018 22:07
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

cool cool LGTM

@jlowin jlowin merged commit 23d59c0 into master Oct 17, 2018
@jlowin jlowin deleted the run-counts branch October 17, 2018 13:31
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