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

Don't override job state when stopped #114

Open
felixplajer opened this issue Jun 6, 2019 · 1 comment
Open

Don't override job state when stopped #114

felixplajer opened this issue Jun 6, 2019 · 1 comment

Comments

@felixplajer
Copy link
Contributor

Right now, when a job runner is stopped (as happens when the JR is shutting down + requests are being suspended), it overrides its job's return state, so the job can never return STATE_FAIL. I know the idea of overriding STATE_FAIL with STATE_STOPPED was that some of jobs probably just return failed when they should really be returning stopped, but with the overriding as is there’s no way to indicate if something really did go wrong when stopping a job and we don’t want to retry it / resume the request

Relevant code here: https://github.com/square/spincycle/blob/master/job-runner/runner/runner.go#L151-L156

@felixplajer
Copy link
Contributor Author

Hmm, this is more complicated than I originally thought. Even if a job returns Failed when Stop is called, the job might have some allowed retries left - so we would probably want to be able to suspend and then retry the job on resume. However, if the runner does return the state as Failed instead of Stopped, then the reaper as it is now will either do a sequence retry, or mark the whole request as failed.

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

No branches or pull requests

1 participant