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

use keepalive on CLI #629

Merged
merged 4 commits into from Jun 30, 2021
Merged

Conversation

philippe44
Copy link
Contributor

Instead of the more aggressive closing of all sockets when a peer disconnects, use TCP keepalive on cli sockets + a monitoring timer. The reason is that multiple instances of an application can share the same target IP address and we don't want to aggressively force close all CLI active socket just because a single instance failed

Instead of the more aggressive closing of all sockets when a peer disconnects, use TCP keepalive on cli sockets + a monitoring timer. The reason is that multiple instances of an application can share the same target IP address and we don't want to aggressively force close all CLI active socket just because a single instance failed
Copy link
Member

@michaelherger michaelherger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're definitely much more familiar with all things sockets. I'll have to trust you on that.

What I do know though, is that timers in LMS aren't always behaving nicely...

@@ -278,63 +281,62 @@ sub cli_socket_accept {
}
}

sub client_socket_keepalive {
my $client_socket = shift;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a killTimers() call here, too. We've had problems in the past where insane numbers of timers got created for whatever reason. Better be safe than sorry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can also not do the timer thing at all and see how it goes. I've tested that and when the KEEPALIVE kicks-in (the peer has disappeared), the socket is closed (at least on Windows). So we can see what happens.

@mherger mherger merged commit 715f435 into LMS-Community:public/8.2 Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants