-
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
response.getTasks() incorrectly parses _tasks/_cancel response #45414
Comments
Pinging @elastic/es-core-features |
Thank you for the submission. Whomever is going to be taking on this work, it will not be a small task. I would like to see client classes created for the request and response, to decouple from the server side classes, as the first step. These classes will (possibly) be leaner than the server side classes as well. The validation should be moved into constructors where possible as well. Then the API will need to be deprecated using the old classes and new methods for the new classes. <3 to whomever would like to take it on 🗡️ 💥 |
I never contributed actively to the project bit I think I could Pick It up. About the approach suggested, you mean that Looking to other issues in HLRC such as #41228 and #29184 the approach you suggest seems the only way to decouple the HLRC from server dependencies, as the server requests and responses are tighty bound to core libraries and classes ( such ascfor example |
@jesinity It would be great for you to do. You are correct in that many of those classes do not need to be present in the client. We also sometimes relax the parameters, for instance an enum server side might just be a string client side without strict validation (it helps for backward comparability). Also, if you look at some of the tests, you can see that unless a request has a body, it should not have a toXContent, because its not needed. The tests implement that portion of the code. |
A good example of not needing complex objects is the |
@jesinity do you think you will be tackling this soon? Or are you in progress? It seems like there might be a few bugs in this API and I would like to see about getting it sorted soon, if you cannot lend time to it. |
yes, I am starting tackling it, I hope I will be able to send a WIP soon. |
excellent!! |
Hi @hub-cap , here is a work in progress of this fix: Some comments:
I did it because I did not find an easy why doing it without falling back again on server side dependencies. |
I went a bit ahead and opened a pull request |
in case when this it is done I think I can tackle the #46062 |
Thanks and I will be getting to this soon. its been a packed few weeks, but im finally out of the woods and can focus on some OSS stuff and review your stuff @jesinity |
Adds support for proper cancel tasks parsing. Closes #45414
Elasticsearch version (
bin/elasticsearch --version
):6.8.1
Plugins installed: []
JVM version (
java -version
):OS version (
uname -a
if on a Unix-like system):Description of the problem including expected versus actual behavior:
Our example docs [1] show how to use the response from a _tasks/_cancel API call via the HLRC. However, the parser [2] is looking for a top level
tasks
object, but it's really nested undernodes.*
in the actual response:[1] https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.8/java-rest-high-cluster-cancel-tasks.html#_cancel_tasks_response
[2] https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java#L96-L99
The text was updated successfully, but these errors were encountered: