-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Java Rest Client swallows exceptions #39910
Comments
Pinging @elastic/es-core-features |
Hi @javanna, thanks for getting back to me so quickly. That does look like it fixes the issue. We have to support elastic 5 and 6 for our clients. Would it be okay if I raise a pull request to back port the fix for 5? I agree about the timeout in principle. We set it so low because the retry logic in the client isn't stack safe and blew our stack in prod. I guess I should probably raise an issue on that front... |
Please do raise an issue! Are you using the low-level REST client or the high-level one? |
Okay will do. We're using 'org.elasticsearch.client.RestClient' via the Elastic4s library. |
Ok that sounds like you are using the low-level REST client, which means that you can happily use the 6.6 client version (which contains the linked fix) against a 5.6 Elasticsearch cluster. |
I'm not sure this will be possible with Elastic4s (standard Scala elastic client library). I'm pretty sure trying to bring in elastic 6 dependencies in conjunction with any Elastic4s 5.* versions will cause a lot of class path problems. #39920 |
Ok sounds like Elastic4s depends on the whole Elasticsearch despite it uses low-level REST client to communicate with it. In that case what I suggested will indeed cause problems. The 5.6 branch is not under active development though, hence I doubt that we will back-port that small fix to it at this point. |
Okay, fair enough |
Closing, see above |
Describe the feature:
Elasticsearch version (
bin/elasticsearch --version
): 5.* and 6.*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:
Actual Behaviour
Make a request to an elastic cluster using the java rest client that fails with a transient exception. If the initial request to the cluster takes longer to fail than the max retry timeout millis the request fails with an IOException and the cause of the initial failure is not added as a suppressed exception.
Expected Behaviour:
Make a request to an elastic cluster using the java rest client that fails with a transient exception. If the initial request to the cluster takes longer to fail than the max retry timeout millis the initial reason for the failure should be added to the IOException as a suppressed exception (this is the behaviour if the client attempts 1+ retry attempts).
Steps to reproduce:
This issue is hard to reproduce in a deterministic fashion. However, we encounter the issue fairly frequently with max retry timeout millis set to 1ms.
Provide logs (if relevant):
The text was updated successfully, but these errors were encountered: