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 prematurely closed BEFORE response #1296
Comments
@martinkrc Is it possible to try the latest releases? |
Do you recommend any specific version? The trouble is that we already did an upgrade (from 0.8.8 to 0.9.7) recently hoping for improvements, but it didn't help and we don't want to waste release effort - the issue can't be reproduced in our test env. Do you see any ticket post 0.9.7 which could be fixing the problem? |
@martinkrc The current releases are Reactor Netty 0.9.11, Spring Boot 2.3.3, Spring Framework 5.2.8 |
@martinkrc One additional question: Is there any kind of timeout on the target server? (For example if you have Tomcat as a target server with connectionTimeout=5s this will automatically configure keepAliveTimeout=5s by default) From the TCP dump I see that the target server might have such timeout (5s?) If that's the case configure the pool with max idle time below 5s, also you may want to switch the pool from FIFO to LIFO leasing strategy so that you will use the most recently used connection. (we have fixes related to FIFO/LIFO leasing in 0.9.11) |
@martinkrc Were you able to try the latest versions? |
@violetagg Need more time, I managed to reproduce the issue somehow locally, but not in a reliable way yet. Next steps would be trying a newer version, but don't have capacity for it at the moment. |
@martinkrc I'm closing this, if you have additional information we can reopen it. |
We're experiencing the "Connections prematurely closed" error frequently in production - most of communication succeeds but some portion of requests fails with the mentioned error.
Expected Behavior
When a connection is successfully used to exchange request/response with the server, Reactor/Netty should not cause failures.
Actual Behavior
As the situation appears to me, sometimes the server side initiates connection closing somewhere around the moment when the client acquires the pooled channel connection, but the connection is still successfully (?) used for request+response and closed at the end, however Reactor/Netty produces "Connection prematurely closed BEFORE response".
Observing from the logs, this is the rough process:
Connection log:
TCP dump:
Steps to Reproduce
We're unable to reproduce the situation in our test environment, it happens purely in production. However, I believe that the attached log and tcpdump will help with issue resolution from Reactor/Netty side.
This is how we create the Spring WebClient used for communication:
Your Environment
The text was updated successfully, but these errors were encountered: