-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[Rollup] Wrong response status on failed requests #39845
Comments
Pinging @elastic/es-analytics-geo |
Started to look into this. I agree the ML uses ML also makes stopping datafeeds idempotent even if they are already stopped. I think this is done to make UI management easier. @jen-huang @cjcenizal any opinions on this? Marking this as team-discuss so I can ask the A&G team in the next meeting. |
Idempotency feels intuitive to me wrt start/stop actions. In those situations, I'd expect a A I guess we're not considering |
I also would vote or Idempotency on those actions as, to me, they are neither
And above all, it is a much nicer UX 😊 The real downside is the breaking change it would create. |
We chatted in the A&G meeting and came to the same conclusion: idempotency and returning We still need to deal with the break this introduces, and the team wasn't sure if this is something we could slide into a minor or not. It's a break, but only if you have special code that does something important the second time an API is called (like as part of a sanity check or test or something). We're leaning towards ok to break that in a minor but wasn't decided. I'll work on a PR and we can discuss what branches it can go into there.
Don't tempt me! :) |
I discovered that Elasticsearch handles differently the response of a common pattern: "Trigger an action that has already been triggered".
Rollup job --> start
When we try to start a rollup job that is already started, Elasticsearch throws a
500 Internal Server Error
instead of a400 Bad Request
.This is the error returned
Rollup job --> stop
This action is idempotent. We can call it as many times as we want, we always get a
Start trial
If we compare the above with the
start trial
API, we can see that it is handled differently. If we have already started the trial and we call the request again we get a403 Forbidden
I think it would be nice to align the way ES handle these types of requests and their status code.
I also realize another wrong status in the Rollup API. When we try to delete a Job that has been started, we receive also a
500 Internal Server Error
instead of a400 Bad Request
.The text was updated successfully, but these errors were encountered: