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

[ML] Return 408 instead of 500 when open/start requests time out #89585

Closed
4 tasks done
dolaru opened this issue Aug 24, 2022 · 1 comment · Fixed by #89775
Closed
4 tasks done

[ML] Return 408 instead of 500 when open/start requests time out #89585

dolaru opened this issue Aug 24, 2022 · 1 comment · Fixed by #89775
Assignees
Labels
>bug :ml/Transform Transform :ml Machine learning Team:ML Meta label for the ML team

Comments

@dolaru
Copy link
Member

dolaru commented Aug 24, 2022

Description

This applies to the following APIs:

  • open anomaly detection
  • start datafeed
  • start data frame analytics job
  • start trained model deployment

Currently, if the operation takes longer than the configured timeout, the response status code is 500.

With Kibana in mind, a 4xx response would be more suitable as it will lead to showing more useful information to the user about why the request failed.

Looking at RFC 9110, it seems the most appropriate 4xx code would be 408 Request Timeout, even though the RFC describes a different situation.

The alternative, 504 Gateway Timeout, would be more appropriate for this situation but it wouldn't improve the user experience in Kibana.

@dolaru dolaru added >enhancement needs:triage Requires assignment of a team area label :ml Machine learning labels Aug 24, 2022
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Aug 24, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@elasticsearchmachine elasticsearchmachine removed the needs:triage Requires assignment of a team area label label Aug 24, 2022
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this issue Aug 25, 2022
This commit changes the status code returned when the start
trained model deployment api times out from `500` to `408`.
In addition, we add validation that the timeout must be positive.

Relates elastic#89585
dimitris-athanasiou added a commit that referenced this issue Aug 25, 2022
This commit changes the status code returned when the start
trained model deployment api times out from `500` to `408`.
In addition, we add validation that the timeout must be positive.

Relates #89585
@dimitris-athanasiou dimitris-athanasiou self-assigned this Sep 1, 2022
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this issue Sep 1, 2022
This changes the response status code from `500` to `408` when
the following ML APIs time out:

- open anomaly detection job
- start datafeed
- start data frame analytics

Closes elastic#89585
dimitris-athanasiou added a commit that referenced this issue Sep 1, 2022
This changes the response status code from `500` to `408` when
the following ML APIs time out:

- open anomaly detection job
- start datafeed
- start data frame analytics

Closes #89585
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :ml/Transform Transform :ml Machine learning Team:ML Meta label for the ML team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants