-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Support wait_for_status and timeout query params on root endpoint #18377
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
base: main
Are you sure you want to change the base?
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
|
This pull request does not have a backport label. Could you fix it @estolfo? 🙏
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, the origial requirement is to have a non-200 status code if the status is not met.
|
|
71ecbbd to
aec5543
Compare
| required: false | ||
| schema: | ||
| type: string | ||
| description: Period to wait for the status to reach the requested target status. If the target status is not reached before the timeout expires, the request returns status code 503. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to external documentation, as do the ES docs
Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
9fe4770 to
31ccb9f
Compare
|
@lcawl, please take a look. |
I pushed a commit that addressed errors caught by
However, IMO we ought to provide a better display name than |
💛 Build succeeded, but was flaky
Failed CI StepsHistory
|

This PR adds support for two query params on the root api:
wait_for_statusandtimeout.They mirror what the same query params do on the elasticsearch cluster health status endpoint.
wait_for_status: One of green, yellow or red.timeoutis required along with a status. Will wait (until the timeout provided) until the status of the service changes to the one provided or better, i.e. green > yellow > red.timeout: Period to wait for the status to reach the requested target status. If the target status is not reached before the timeout expires, the request returns http status 408.The status of the service will be checked with an exponential backoff until the timeout is reached.
Short description of the behavior:
green,yellow,red] - return error response and http status 400Open Questions/ToDo:
Right now, the implementation doesn't wait for a status that is "better, i.e. green > yellow > red", as the Elasticsearch implementation does. Do we want to adjust our implementation to also have this behavior or is that overkill?The implementation will do the same as Elasticsearch-- it will wait for a status that matches the target or "better".If the timeout is expired on the Elasticsearch cluster health endpoint before the target status is reached (or a better one), the request fails and returns an error. This implementation currently just returns as normal. Do we want to have the same behavior as Elasticsearch?The request will return 503 if the request times out and the target status is not reached, as does ElasticsearchWhat examples should be used for "host" and "name" in the openapi documentation? The guidelines suggestUpdate: usedapi.example.combut that doesn't seem to fit the example of calling logstash's root api.logstash-pipelines,logstash-pipelines.example.comConfirm that the status code 503 should be used when the request times out. Define message based on what elasticsearch returns.Update: testing showed that status code 408 is returned when the request times out.Resolves #17457