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
close socket after a complete write in TcpClient output #1247
base: master
Are you sure you want to change the base?
Conversation
e2afeaf
to
37c7736
Compare
Seems now it has build error which is irrelevant to the PR? |
yes it was unrelated - see #1249 |
Anyone who can kindly review this? |
Did you already test this fix? Does it solve the problem you observe? |
Hi @marchof I have manually tested local (not by unit test, I deliberately added some code to simulate multi-threading execution) and didn't observe the problem currently. |
@ganxiyun I mean does this patch resolve the problem in your setup that you describe at the beginning? |
@marchof YES. After applying this patch, I didn't observe the problem currently. |
@ganxiyun Ok, thanks for the info! I'm a bit reluctant to merge this without fully understanding the impact. My questions are:
|
@marchof I could understand you concern.
I checked the code and class diagram (generated by Intellij) in
If all data has been written to the socket before calling multi-threading is not easy to test etc., your review opinion values a lot. |
I have many java processes running in
output=tcpclient
mode, the process keeps running a bit long.When I check the log in the server side (on which tcpclient connects to), I see several EOFException.
After some investigation, the socket might be closed in client side while the
RemoteControlWriter
is still writing data to server side, therefore the server receives partial data and throws EOFException.I can see such
EOFException
happening almost every time in my case (Many connections with long running period), although not big problem, I create this PR trying to fix it. Please kindly have a review.