Hi,
I looked at the code of FlowCapableInventoryProvider.
The thread that polls from the queue (Named "FlowCapableInventoryProvider") 
died at our system, because of an exception in one of the handlers.
Why isn't the run() loop protected from exceptions?

FlowCapableInventoryProvider

Nothing protects the run() from Exceptions.

@Override
    public void run() {
        try {
            for (; ; ) {
                InventoryOperation op = queue.take();
                int ops = 0;
                final ArrayList<InventoryOperation> opsToApply = new 
ArrayList<>(MAX_BATCH);
                do {
                    opsToApply.add(op);
                    ops++;
                    if (ops < MAX_BATCH) {
                        op = queue.poll();
                    } else {
                        op = null;
                    }
                } while (op != null);
                submitOperations(opsToApply);
            }
        } catch (final InterruptedException e) {
            LOG.info("Processing interrupted, terminating", e);
        }

        // Drain all events, making sure any blocked threads are unblocked
        while (!queue.isEmpty()) {
            queue.poll();
        }
    }

The exception:
Exception in thread "FlowCapableInventoryProvider" 
java.lang.IllegalArgumentException: Instance identifier references 
(urn:opendaylight:inventory?revision=2013-08-19)node-connector[{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:4:3}]
 but data identifier is 
ImmutableMapEntryNode{nodeIdentifier=(urn:opendaylight:inventory?revision=2013-08-19)node-connector[{(urn:opendaylight:inventory?revision=2013-08-19)id=3}],
 
value=[ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:inventory?revision=2013-08-19)id,
 value=3, attributes={}}], attributes={}}
        at 
com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
        at 
org.opendaylight.controller.cluster.databroker.DOMBrokerWriteOnlyTransaction.checkInstanceIdentifierReferencesData(DOMBrokerWriteOnlyTransaction.java:86)
        at 
org.opendaylight.controller.cluster.databroker.DOMBrokerWriteOnlyTransaction.merge(DOMBrokerWriteOnlyTransaction.java:100)
        at 
org.opendaylight.controller.md.sal.binding.impl.AbstractWriteTransaction.merge(AbstractWriteTransaction.java:60)
        at 
org.opendaylight.openflowplugin.applications.inventory.manager.NodeChangeCommiter$2.applyOperation(NodeChangeCommiter.java:106)
        at 
org.opendaylight.openflowplugin.applications.inventory.manager.FlowCapableInventoryProvider.createCustomizedTransaction(FlowCapableInventoryProvider.java:167)
        at 
org.opendaylight.openflowplugin.applications.inventory.manager.FlowCapableInventoryProvider.submitOperations(FlowCapableInventoryProvider.java:108)
        at 
org.opendaylight.openflowplugin.applications.inventory.manager.FlowCapableInventoryProvider.run(FlowCapableInventoryProvider.java:82)
        at java.lang.Thread.run(Unknown Source)


Thanks,
Guy Sela

_______________________________________________
openflowplugin-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev

Reply via email to