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
Connection reuse leads to Connection prematurely closed BEFORE response #1170
Comments
@mp911de @rstoyanchev @simonbasle The connection is closed by Spring Framework WebClient's new change for disposing the connection when a cancellation happens
|
So there must be a cancel before the response content is subscribed to? Is it known where the cancel signal comes from and what was the outcome before? |
I see this, unfortunately I do not know what the test is supposed to do
|
@mp911de can you clarify the scenario? |
Cancellation happens by |
The following was reported after the change and is related to it: reactor/reactor-netty#1170. An HTTP HEAD with the body not consumed. Connection is disposed and closed leading to subsequent request to fail. Adding toBodilessEntity() helps. This change does not close the connection but rather drains the body which does not impact subsequent re-use of the connection. This however may compete with a late subscriber actually attempting to read the response. At that point there is little choice but to raise an ISE with a more specific description. See gh-25216
This can be closed now, following spring-projects/spring-framework@21d0696 |
The following was reported after the change and is related to it: reactor/reactor-netty#1170. An HTTP HEAD with the body not consumed. Connection is disposed and closed leading to subsequent request to fail. Adding toBodilessEntity() helps. This change does not close the connection but rather drains the body which does not impact subsequent re-use of the connection. This however may compete with a late subscriber actually attempting to read the response. At that point there is little choice but to raise an ISE with a more specific description. See spring-projectsgh-25216
Actual Behavior
Reusing pooled connections cause
Connection prematurely closed BEFORE response
Steps to Reproduce
The issue happens in the scope of a CI build of Spring Data Elasticsearch (https://github.com/spring-projects/spring-data-elasticsearch/)
Possible Solution
Using
HttpClient.newConnection().compress(true)
is a workaround.Your Environment
netty
, ...): 4.1.50.Finaljavar -version
): 1.8.0_232uname -a
): MacOS, Darwin Kernel Version 19.5.0The text was updated successfully, but these errors were encountered: