Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-531

Can't detect switch disconnection

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • None
    • None
    • mdsal
    • None
    • Operating System: Windows
      Platform: PC

    • 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));
      }
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tony.tkacik@gmail.com Tony Tkacik
            jimoo99@hotmail.com Jim O
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: