Class StalePassiveConnectionService

  • All Implemented Interfaces:
    AutoCloseable

    public class StalePassiveConnectionService
    extends Object
    implements AutoCloseable
    StalePassiveConnectionService provides functionalities to clean up stale passive connections from the same node before new connection request arrives, especially for connection flapping scenarios.

    When new connection arrives all connections from the same node are pinged. The pings cause the stale netty connections to close due to IOException. Those have not been closed after a timeout will be closed programmatically. New connection request handling is then proceeded after all stale connections are cleaned up in the OvsdbConnectionService

    Author:
    Vinh Nguyen (vinh.nguyen@hcl.com) on 6/10/16.
    • Constructor Detail

      • StalePassiveConnectionService

        public StalePassiveConnectionService​(Function<OvsdbClient,​Void> clientNotificationCallback)
    • Method Detail

      • handleNewPassiveConnection

        public void handleNewPassiveConnection​(OvsdbClient newOvsdbClient,
                                               List<OvsdbClient> clientsFromSameNode)
        This method makes sure that all stale connections from the same node are properly cleaned up before processing new connection request.
        Parameters:
        newOvsdbClient - the connecting OvsdbClient
        clientsFromSameNode - list of existing OvsdbClients from the same node as the new OvsdbClient
      • clientDisconnected

        public void clientDisconnected​(OvsdbClient disconnectedClient)
        Notify the service that the given client has disconnected.
        Parameters:
        disconnectedClient - the client just disconnected
      • onInactiveClient

        public void onInactiveClient​(OvsdbClient disconnectedClient)