Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Incorrect response code and error when API scaling breaks limits #59

Closed
jrasell opened this issue Oct 1, 2019 · 2 comments · Fixed by #62
Closed

Incorrect response code and error when API scaling breaks limits #59

jrasell opened this issue Oct 1, 2019 · 2 comments · Fixed by #62
Assignees
Labels
area/api Issues related to the API area/scaling Issues related to scaling kind/bug Issues relating to bugs

Comments

@jrasell
Copy link
Owner

jrasell commented Oct 1, 2019

Describe the bug
When attempting to scale a job by a count which will break the configured policy thresholds, the returned error is empty and the response code is 304. The error should include details of what problem occurred. The response code should be 403, to indicate the request contained valid parameters, but was rejected by the server.

@jrasell jrasell added area/scaling Issues related to scaling kind/bug Issues relating to bugs area/api Issues related to the API labels Oct 1, 2019
@jrasell jrasell self-assigned this Oct 1, 2019
@pmcatominey
Copy link
Contributor

My suggestion for this would be to use 409 or 412 to avoid any confusion with auth with is where 403 is most commonly used.

@jrasell
Copy link
Owner Author

jrasell commented Oct 1, 2019

good shout @pmcatominey

jrasell added a commit that referenced this issue Oct 1, 2019
The acceptance testing has been expanded to cover scaling actions
as well as the Nomad meta policy backend. The Nomad meta engine
requires Sherpa to run in a different mode than the rest of the
tests, therefore the make targets have been split to make this
clear until the whole process is automated.

The scale tests are particulary basic, but are a start for further
work in the future.

These tests have already uncovered #59.
jrasell added a commit that referenced this issue Oct 2, 2019
Previously errors when triggering a scaling action such as the
new count breaking policy thesholds would result in a 304 response
code and an empty message. This changes fixes the behaviour so
that the client will recieve a 409 response code with a useful
message to indicate the reason for not performing the action.

Closes #59
jrasell added a commit that referenced this issue Oct 2, 2019
Fix incorrect response code and msg when scaling breaks thresholds
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api Issues related to the API area/scaling Issues related to scaling kind/bug Issues relating to bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants