Package org.opendaylight.ovsdb.lib.impl
Class StalePassiveConnectionService
java.lang.Object
org.opendaylight.ovsdb.lib.impl.StalePassiveConnectionService
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionStalePassiveConnectionService
(Function<OvsdbClient, Void> clientNotificationCallback) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clientDisconnected
(OvsdbClient disconnectedClient) Notify the service that the given client has disconnected.void
close()
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.void
onInactiveClient
(OvsdbClient disconnectedClient)
-
Constructor Details
-
StalePassiveConnectionService
-
-
Method Details
-
getPendingClients
-
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 OvsdbClientclientsFromSameNode
- list of existing OvsdbClients from the same node as the new OvsdbClient
-
clientDisconnected
Notify the service that the given client has disconnected.- Parameters:
disconnectedClient
- the client just disconnected
-
onInactiveClient
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-