-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix TCP client to detect connection closures #108
Conversation
Executing the reproduction steps from #99, it doesn't look like it resolves the problem specifically with half-open sockets:
Updating the reproducing code to have an extra log message also doesn't seem to work quite as expected -- it appears to duplicate the second message on retry:
Output:
|
The retryQueue was interfering with |
@@ -65,13 +63,22 @@ public synchronized void sendMessage(String message) { | |||
} | |||
|
|||
try { | |||
// Write a space to the socket to verify connection before sending event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment should include why we need this, rather what.
I pulled the latest changes and attempted to run the reproduction code again (see previous comment). My results were as follows:
Neither of these tests resulted in the expected behavior. |
@brandondahler I ran tests again and I see now that in about 5% of the cases, the socket doesn't detect its closure in time and the message gets lost. |
Issue #, if available: #99
Description of changes:
Added an additional empty
os.write()
tosendMessage()
to test socket connection.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.