-
Notifications
You must be signed in to change notification settings - Fork 570
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
clients not being cleaned up properly #145
Comments
I tried your instructions but I haven't been able to reproduce. I waited 10 minutes. There aren't any timeouts defined on the Tile38 server-side. It's pretty basic actually. Just a listen/accept pattern. Could you provide some details on your environment? If I can reproduce, then I can watch the packets on wire and see which side it's coming from. Regardless of which side it's coming from though, perhaps we could set up keepalives on the TCP connections on the server. This would allow for the server to discover when a client drops off. The downside is that under-the-hood there's a little more traffic being sent around. |
In fact, I think we should just add keepalives. |
I'm marking this issue as a bug, because the server should be responsible for managing it's connections, and TCP keepalives were created for this purpose. TODO: Add TCP keepalives after the server accepts a tcp connection. Set the default period to 300 seconds. Add a config option to define the period duration. |
Enabled TCP keepalive packets to determine if the connection is still valid, and terminate if needed. It also helps with maintaining idle connections. Default to 300 seconds and can be changed by: CONFIG SET keepalive 300 addresses #145: clients not being cleaned up properly
I just pushed an update to the master branch which should address this issue. Please test again and let me know. Thanks. |
@UriHendler I ran a few tests pulling over physical networks using cat-5 by hot unplugging cables and watching timeouts. The keepalive code seems to behave well. I'm closing this as fixed for now. Feel free to reopen if you see any problems. Thanks for you help! |
When the TCP connection is dropped from the client side, Tile38 still keeps the client in its list of connections.
Here's an example when using tile38-cli:
Start new client
The Tile38 log shows the connection:
2017/02/09 09:32:22 [DEBU] opened connection: 1.2.3.4:3086
Let the client be idle for a minute or two. This causes the connection to timeout (not sure where this is set).
Send a command.
Client gives a TCP error message and exits, but the Tile38 log does not show an error or "closed connection" message. (At this point, the TCP port has been released to the OS, as expected.)
To check/fix:
It seems the TCP connection timeout is set on the Tile38 side. Where/how is this configured?
Are the clients being cleaned up when the TCP connection is dropped?
The text was updated successfully, but these errors were encountered: