Skip to content

Commit

Permalink
Merge e7136f8 into backport/bug-scale-status-index/adversely-right-go…
Browse files Browse the repository at this point in the history
…bbler
  • Loading branch information
hc-github-team-nomad-core committed Oct 3, 2023
2 parents 9caa3b3 + e7136f8 commit 271ea2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/18637.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
scaling: Unblock blocking queries to /v1/job/{job-id}/scale if the job goes away
```
7 changes: 6 additions & 1 deletion nomad/job_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -2209,8 +2209,13 @@ func (j *Job) ScaleStatus(args *structs.JobScaleStatusRequest,
return err
}
if job == nil {
// HTTPServer.jobScaleStatus() will 404 if this is nil
reply.JobScaleStatus = nil
return nil

// reply with latest index, since if the job does get created,
// it must necessarily be later than current latest.
reply.Index, err = state.LatestIndex()
return err
}

events, eventsIndex, err := state.ScalingEventsByJob(ws, args.RequestNamespace(), args.JobID)
Expand Down

0 comments on commit 271ea2e

Please sign in to comment.