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
SSLException on request cancellation #1165
Comments
@kushagraThapar From the reproducible example I do not see how this |
@violetagg Thank you for looking at the issue. Regarding cancellations, what should be the recommended way to handle cancellations. I think that is one part of the problem, or in fact could be the major issue here. |
@kushagraThapar You do not subscribe for the inbound but you "wrap" the connection that Reactor Netty provides. reactor-netty/src/main/java/reactor/netty/http/client/HttpClientFinalizer.java Lines 95 to 97 in 10c7f70
reactor-netty/src/main/java/reactor/netty/http/client/HttpClientFinalizer.java Lines 119 to 121 in 10c7f70
In the issue above that I mentioned the solution that was applied to WebClient is when a cancellation is received, they consume/drain the inbound. spring-projects/spring-framework@21d0696 |
@violetagg - Thank you for these wonderful insights and the explanation, it makes sense. I am still facing the issue, though one interesting thing I noticed is - for my scenario, the cancellation is happening before the response comes on the http client, because of which I am not able to consume/drain the inbound. I added more logging to verify this. If you take a look or run the example, you will notice that this |
@kushagraThapar Yes as I wrote with this concrete example I do not see how this |
@violetagg - I agree and it is possible that Though at this point, our main concern is to get this issue fixed, since OOM happens rarely and it can be worked around by increasing the heap size for now. |
@kushagraThapar Will you be able to test PR #1198 ? |
@violetagg - Thanks for the PR, I can definitely try it out. Will post the update once I am able to test it, hopefully today. |
@violetagg - I was able to test the PR and it definitely fixes the issue in the example test application, thank you so much for that. However, in my SDK, I am still seeing the issue with the fix PR version. Here are some interesting observations from my debugging today in SDK code.
Here is the latests stack trace that I am getting now, not sure if this is same as the above one, but just wanted to provide this.
|
@kushagraThapar Thanks. I committed an additional fix to the PR, if you can test it, it will be great! |
Definitely, let me test it out .. will update you with the results. |
@violetagg - for some reason I am not able to build the latest changes in the PR. I tried multiple times, and the build is not completing.. Here are the commands I tried :
I am seeing a lot of test failures as well , which I don't remember seeing last time (but I could be wrong)
Please let me know if there is a faster way to build the library locally ? |
@kushagraThapar can you try just |
@violetagg - I verified and this fix works well :) Thank you so much for your efforts and fixing this issue. Let me know once this gets released, I will update the azure java sdks to the released version. |
@kushagraThapar Thanks for testing the fix. It will be available with next release 0.9.10. |
@violetagg - can you please let me know the tentative release date for 0.9.10.RELEASE ? |
@kushagraThapar the current plan is for 20.07. We will release both reactor core + netty. |
In our SDK we are seeing
javax.net.ssl.SSLException: SSLEngine closed already
exceptions.We are using fixed channel pool - ConnectionProvider with 1000 as pool size.
Expected Behavior
On cancel operation, channel should be closed / disposed quietly since the operation has been cancelled. Whether that channel is reusable or not can be a point of discussion.
Actual Behavior
Combination of pagination +
takeUntil
operator causes SSLException. In high load, the error keeps happening, and thus causing Out of Memory issue.Steps to Reproduce
I was able to reproduce the issue on an isolated project - which is exactly same we have reactor-netty http client in Azure CosmosDB Java SDK.
Here is the link to the project I have created : https://github.com/kushagraThapar/reactor-netty-ssl-error
Run the MainApplication.java in IDE for couple of minutes and the error starts happening.
For testing purpose, I have kept the connection pool size to 5.
Your Environment
macOS / linux machines
reactor-netty: 0.9.7.RELEASE
reactor-core: 3.3.5.RELEASE
Here is the complete stack trace:
The text was updated successfully, but these errors were encountered: