Don't override job state when stopped

Open
#114 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
go

Research direction

Start in job-runner/runner/runner.go at lines 151-156 and trace how a stopped job's return state is handled during shutdown. Confirm the desired behavior by checking that a genuine STATE_FAIL remains distinguishable from STATE_STOPPED, then verify the stopping path and its existing tests if present.

Written by the indexing model from the issue text.

Description

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

Dominant language
Go
Stars
125
Forks
24
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.