[CONTROLLER-531] Can't detect switch disconnection Created: 02/Jun/14  Updated: 25/Jul/23  Resolved: 15/Jul/14

Status: Resolved
Project: controller
Component/s: mdsal
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Jim O Assignee: Tony Tkacik
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC


External issue ID: 1125

 Description   

To detect when a switch disconnects, I register a datachangelistener on InstanceIdentifier.builder(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)

Then I get the set from changeEvent.getRemovedOperationalData() and see if it is a FlowCapableNode. If it is, I take that to mean the node has disconnected.

This was working in builds from April but is no longer working. I'm not getting any notifications when a switch disconnects.

Here are some code snippets:

dataChangeListenerRegistration = dataBrokerService.registerDataChangeListener(InstanceIdentifier.builder(Nodes.class)
.child(Node.class)
.toInstance(),
this);

final Set<InstanceIdentifier<?>> removedSet = changeEvent.getRemovedOperationalData();

for (final InstanceIdentifier<?> removedItemPath : removedSet)
{
final InstanceIdentifier<Node> switchPath = IIDUtil.getSwitchPath(removedItemPath);
final Class removedClass = removedItemPath.getTargetType();
final String className = removedClass.getSimpleName();
log.debug("Removed: {}", className);

if (className.contains("FlowCapableNode"))
{
log.debug("REMOVED SWITCH: switch{}", IIDUtil.getSwitchId(switchPath));
}
}



 Comments   
Comment by Ed Warnicke [ 03/Jun/14 ]

This may or may not be an MD-SAL issue... hard to say. The simplest way to approach it would be to:

a) Create a unit test to write an operational node, remove it, and see if the datachange listener fires.
b) If the unit test passes, drill down into topology-manager and ofplugin to find the origin of the issue.

Comment by Tony Tkacik [ 14/Jul/14 ]

Tried to replicate with current master, seems to work,
added regresion test suite with listeenr attached to
augmentation, all delete scenarios works (top-level element,
list item or augmentation).

https://bugs.opendaylight.org/show_bug.cgi?id=1125

Generated at Wed Feb 07 19:53:15 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.