mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-18 10:51:04 +02:00
[ONOS-4789]some services don't remove listener in deactive function
Change-Id: I74c3f4eb14edcd93d06a8838a4205df381c7f678
This commit is contained in:
parent
a1a590b921
commit
e0eb5ce4d0
@ -257,6 +257,7 @@ public class GossipDeviceStore
|
|||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
public void deactivate() {
|
public void deactivate() {
|
||||||
|
devicePortStats.removeListener(portStatsListener);
|
||||||
devicePortStats.destroy();
|
devicePortStats.destroy();
|
||||||
devicePortDeltaStats.destroy();
|
devicePortDeltaStats.destroy();
|
||||||
executor.shutdownNow();
|
executor.shutdownNow();
|
||||||
@ -274,6 +275,24 @@ public class GossipDeviceStore
|
|||||||
devices.clear();
|
devices.clear();
|
||||||
devicePorts.clear();
|
devicePorts.clear();
|
||||||
availableDevices.clear();
|
availableDevices.clear();
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.DEVICE_UPDATE);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.DEVICE_OFFLINE);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.DEVICE_REMOVE_REQ);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.DEVICE_REMOVED);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.PORT_UPDATE);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.PORT_STATUS_UPDATE);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.DEVICE_ADVERTISE);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.DEVICE_INJECTED);
|
||||||
|
clusterCommunicator.removeSubscriber(
|
||||||
|
GossipDeviceStoreMessageSubjects.PORT_INJECTED);
|
||||||
log.info("Stopped");
|
log.info("Stopped");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ public class DistributedFlowObjectiveStore
|
|||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
public void deactivate() {
|
public void deactivate() {
|
||||||
|
nextGroups.removeListener(mapListener);
|
||||||
tpool.shutdown();
|
tpool.shutdown();
|
||||||
log.info("Stopped");
|
log.info("Stopped");
|
||||||
}
|
}
|
||||||
|
@ -135,11 +135,12 @@ public class DistributedGroupStore
|
|||||||
groupEntriesById = new ConcurrentHashMap<>();
|
groupEntriesById = new ConcurrentHashMap<>();
|
||||||
private ConsistentMap<GroupStoreKeyMapKey,
|
private ConsistentMap<GroupStoreKeyMapKey,
|
||||||
StoredGroupEntry> auditPendingReqQueue = null;
|
StoredGroupEntry> auditPendingReqQueue = null;
|
||||||
|
private MapEventListener<GroupStoreKeyMapKey, StoredGroupEntry>
|
||||||
|
mapListener = new GroupStoreKeyMapListener();
|
||||||
private final ConcurrentMap<DeviceId, ConcurrentMap<GroupId, Group>>
|
private final ConcurrentMap<DeviceId, ConcurrentMap<GroupId, Group>>
|
||||||
extraneousGroupEntriesById = new ConcurrentHashMap<>();
|
extraneousGroupEntriesById = new ConcurrentHashMap<>();
|
||||||
private ExecutorService messageHandlingExecutor;
|
private ExecutorService messageHandlingExecutor;
|
||||||
private static final int MESSAGE_HANDLER_THREAD_POOL_SIZE = 1;
|
private static final int MESSAGE_HANDLER_THREAD_POOL_SIZE = 1;
|
||||||
|
|
||||||
private final HashMap<DeviceId, Boolean> deviceAuditStatus = new HashMap<>();
|
private final HashMap<DeviceId, Boolean> deviceAuditStatus = new HashMap<>();
|
||||||
|
|
||||||
private final AtomicInteger groupIdGen = new AtomicInteger();
|
private final AtomicInteger groupIdGen = new AtomicInteger();
|
||||||
@ -198,7 +199,7 @@ public class DistributedGroupStore
|
|||||||
.withName("onos-group-store-keymap")
|
.withName("onos-group-store-keymap")
|
||||||
.withSerializer(serializer)
|
.withSerializer(serializer)
|
||||||
.build();
|
.build();
|
||||||
groupStoreEntriesByKey.addListener(new GroupStoreKeyMapListener());
|
groupStoreEntriesByKey.addListener(mapListener);
|
||||||
log.debug("Current size of groupstorekeymap:{}",
|
log.debug("Current size of groupstorekeymap:{}",
|
||||||
groupStoreEntriesByKey.size());
|
groupStoreEntriesByKey.size());
|
||||||
|
|
||||||
@ -216,6 +217,7 @@ public class DistributedGroupStore
|
|||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
public void deactivate() {
|
public void deactivate() {
|
||||||
|
groupStoreEntriesByKey.removeListener(mapListener);
|
||||||
cfgService.unregisterProperties(getClass(), false);
|
cfgService.unregisterProperties(getClass(), false);
|
||||||
clusterCommunicator.removeSubscriber(GroupStoreMessageSubjects.REMOTE_GROUP_OP_REQUEST);
|
clusterCommunicator.removeSubscriber(GroupStoreMessageSubjects.REMOTE_GROUP_OP_REQUEST);
|
||||||
log.info("Stopped");
|
log.info("Stopped");
|
||||||
|
@ -86,6 +86,12 @@ public class GossipIntentStore
|
|||||||
|
|
||||||
private final AtomicLong sequenceNumber = new AtomicLong(0);
|
private final AtomicLong sequenceNumber = new AtomicLong(0);
|
||||||
|
|
||||||
|
private EventuallyConsistentMapListener<Key, IntentData>
|
||||||
|
mapCurrentListener = new InternalCurrentListener();
|
||||||
|
|
||||||
|
private EventuallyConsistentMapListener<Key, IntentData>
|
||||||
|
mapPendingListener = new InternalPendingListener();
|
||||||
|
|
||||||
@Activate
|
@Activate
|
||||||
public void activate() {
|
public void activate() {
|
||||||
KryoNamespace.Builder intentSerializer = KryoNamespace.newBuilder()
|
KryoNamespace.Builder intentSerializer = KryoNamespace.newBuilder()
|
||||||
@ -111,14 +117,16 @@ public class GossipIntentStore
|
|||||||
.withPeerUpdateFunction((key, intentData) -> getPeerNodes(key, intentData))
|
.withPeerUpdateFunction((key, intentData) -> getPeerNodes(key, intentData))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
currentMap.addListener(new InternalCurrentListener());
|
currentMap.addListener(mapCurrentListener);
|
||||||
pendingMap.addListener(new InternalPendingListener());
|
pendingMap.addListener(mapPendingListener);
|
||||||
|
|
||||||
log.info("Started");
|
log.info("Started");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deactivate
|
@Deactivate
|
||||||
public void deactivate() {
|
public void deactivate() {
|
||||||
|
currentMap.removeListener(mapCurrentListener);
|
||||||
|
pendingMap.removeListener(mapPendingListener);
|
||||||
currentMap.destroy();
|
currentMap.destroy();
|
||||||
pendingMap.destroy();
|
pendingMap.destroy();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user