Skip to content
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

enhancement: Detect TCP disconnects earlier in socket and vector sinks #2209

Merged
merged 2 commits into from Apr 3, 2020

Conversation

bruceg
Copy link
Member

@bruceg bruceg commented Apr 2, 2020

Closes #1429

It is unclear to me how this could be reliably tested. I could probably craft up a receiver that would drop the connection mid stream, but this would produce all manner of races. It would also be difficult (impossible?) to tell the difference between the normal disconnect handling and this enhancement.

Bruce Guenter added 2 commits April 2, 2020 14:22
Signed-off-by: Bruce Guenter <bruce@timber.io>
Signed-off-by: Bruce Guenter <bruce@timber.io>
@bruceg bruceg added sink: socket Anything `socket` sink related type: enhancement A value-adding code change that enhances its existing functionality. sink: vector Anything `vector` sink related domain: networking Anything related to Vector's networking labels Apr 2, 2020
@bruceg bruceg requested a review from lukesteensen April 2, 2020 22:00
@bruceg bruceg self-assigned this Apr 2, 2020
@binarylogic
Copy link
Contributor

Would it be helpful/eaier to test this in the test harness? It's definitely more of a pain to do, but makes full integration tests like this possible.

@bruceg
Copy link
Member Author

bruceg commented Apr 2, 2020

I don't see how the test harness would make any difference. Without explicit acknowledgements in the protocol, there will always be a race between the remote closing the connection (and so dropping anything else sent on the socket) and this sink detecting the closure (and so dropping anything already sent). The purpose of this PR is to narrow the gap, but it cannot be closed. The question I was raising was how to reliably determine that the gap has been narrowed.

@bruceg bruceg merged commit b3450b3 into master Apr 3, 2020
@bruceg bruceg deleted the tcp-detect-disconnect branch April 3, 2020 15:27
@binarylogic
Copy link
Contributor

Nice work! Glad we got this resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: networking Anything related to Vector's networking sink: socket Anything `socket` sink related sink: vector Anything `vector` sink related type: enhancement A value-adding code change that enhances its existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TCP and vector sinks don't detect disconnects
3 participants