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

scaling: set Index on nil-job scale status reply #18637

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Conversation

gulducat
Copy link
Member

@gulducat gulducat commented Oct 2, 2023

I noticed this while working on hashicorp/nomad-autoscaler#604 -- When a job went away, the blocking query on /v1/job/{job-id}/scale kept blocking for the full 5 minute timeout, instead of returning "not found" as soon as the job was purged/gc'd.

returning a nil error in a blockingOptions.run()
without increasing the reply Index can cause the
query to block indefinitely (until timeout).

this fixes that happening in Job.ScaleStatus
when the job is deleted -- the job going away
should now return as not-found and provide a new
index for the caller to try if they so please.

returning a nil error in a blockingOptions.run()
without increasing the reply Index can cause the
query to block indefinitely (until timeout).

this fixes that happening in Job.ScaleStatus
when the job is deleted -- the job going away
should now return as not-found and provide a new
index for the caller to try if they so please.
@gulducat gulducat added backport/1.4.x backport to 1.4.x release line backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line labels Oct 2, 2023
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

LGTM.

Do we want to add a changelog entry, to call out the potential change in behaviour for callers of this function?

@gulducat
Copy link
Member Author

gulducat commented Oct 3, 2023

Ah yes for the changelog - I made one yesterday, just didn't actually push it until this morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.4.x backport to 1.4.x release line backport/1.5.x backport to 1.5.x release line backport/1.6.x backport to 1.6.x release line theme/autoscaling Issues related to supporting autoscaling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants