tahrir
tahrir copied to clipboard
Connection should disconnect if it doesn't get a keepalive in a while
Connections should keep track of the last time they received a KEEPALIVE message from the other guy (handled on line 193 of UdpRemoteConnection) and call disconnect() if a keepalive hasn't been received in a certain amount of time.
Keepalives are sent every 7 seconds currently (TrConstants.UDP_KEEP_ALIVE_DURATION), so 30 seconds might be a good timeout.
A disconnecting node which knows it's disconnecting because of TopologyMaintenance should also call a disconnect() session. This isn't happening as can be seen in LongTests.main().
@nomel7 Can you elaborate on what you mean here?
If a node reaches its max peers, and is "changing" some of its peers because of a maintenance session, it should notify the peers that it's removing those peers so that they can in turn remove the "changer". Currently the node which is disconnected from doesn't know that it has been removed by the "changer" and may still try start sessions with the "changer".