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
Catch Exceptions thrown in LLRC callbacks to protect the client IO Reactor Thread #45115
Comments
Pinging @elastic/es-core-features |
We are observing a similar problem where the RestHighLevelClient is not catching IllegalStateException (See below for stack trace). Shouldn't RestHighLevelClient catch all exceptions (github link) and wrap them under an IOException or an ElasticsearchException?
|
Does anyone know what Version of ESClient is affected by this ? We are seeing this exception in 6.2.x but not in 6.4.0 version yet. Does that mean it is fixed in 6.4.0 version? |
I have been spending some time in the HTTP Client code lately to try and understand what might cause the IOReactor to shutdown prematurely. I've tried to replicate throwing exceptions from the client in this manner but have not been successful in killing the IOReactor. I'm further convinced that this is not the cause because in other methods in the LLRC we may throw exceptions that are based on RuntimeException like deprecation warnings in Strict mode. Instead, it seems that in the layers between the LLRC code and the IOReactor there are specific catch blocks that should protect the IOReactor from all runtime and checked Exceptions. This happens in the In the mean time, I'm going to close this out since I don't see much evidence that this may be the cause for failures. |
I have been struggling with this very issue for a while. It occurs when unit tests are being executed in our CI/CD system (TeamCity). Sometimes it also happens locally, but it is not reproducible in a deterministic manner in either environment (locally or on TC). I know the issue has been closed, but just to point out that this is still and issue (and hoping that it will get fixed as part of #49124). |
In the LLRC, we do not handle
RuntimeException
s thrown in theonFailure
listener of a request callback.So e.g. this code:
will cause a broken client because the exception bubbles up in the IOReactor and it's being hard-shutdown as a result. This is something we should fix. It's always possible that due to some unforeseen state/bug/... an exception is thrown in the failure handler. While that shouldn't happen and callback code should be fixed, it's not right to simply silently shut down the io reactor here and fail subsequent requests (there isn't even logging in the example code above). Instead, we should probably catch all exceptions and worst case log a warning for the unhandled ones and not let them break the client.
Split off from #42133
The text was updated successfully, but these errors were encountered: