From 69bb0fee617b0d8a9fb8154cb47df8393208fbc4 Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Thu, 4 Sep 2014 16:13:10 -0700 Subject: [PATCH] InMemoryDOMDataStore$DOMStoreTransactionChainImpl isnt happy if there are mulitple transactions queued in quick succession. And it throws java.lang.IllegalStateException: Previous transaction in chain must be ready. at com.google.common.base.Preconditions.checkState(Preconditions.java:149) ~[na:na] at org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore$DOMStoreTransactionChainImpl.newReadWriteTransaction when we reuse the txchain. Fixing it temporarily. Better solution is to get away from this and use DataChangeListener. Change-Id: Id20abdefc21574dce9ff078f4ce96aa91c390edb Signed-off-by: Madhu Venugopal --- .../netvirt/providers/openflow13/AbstractServiceInstance.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/AbstractServiceInstance.java b/openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/AbstractServiceInstance.java index 934f763bf..5c071454a 100644 --- a/openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/AbstractServiceInstance.java +++ b/openstack/net-virt-providers/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/providers/openflow13/AbstractServiceInstance.java @@ -81,8 +81,6 @@ public abstract class AbstractServiceInstance implements OpendaylightInventoryLi // Concrete Service that this AbstractServiceInstance represent private Service service; - private BindingTransactionChain txChain; - // Process Notification in its own thread Thread thread = null; private final BlockingQueue queue = new LinkedBlockingDeque<>(); @@ -112,7 +110,6 @@ public abstract class AbstractServiceInstance implements OpendaylightInventoryLi if (notificationService != null) { notificationService.registerNotificationListener(this); } - this.txChain = mdsalConsumer.getDataBroker().createTransactionChain(this); // Never block a Notification thread. Process the notification in its own Thread. thread = new Thread(this); @@ -340,6 +337,7 @@ public abstract class AbstractServiceInstance implements OpendaylightInventoryLi InstanceIdentifierBuilder builder = ((InstanceIdentifier) ref.getValue()).builder(); InstanceIdentifierBuilder augmentation = builder.augmentation(FlowCapableNode.class); final InstanceIdentifier path = augmentation.build(); + BindingTransactionChain txChain = mdsalConsumer.getDataBroker().createTransactionChain(this); CheckedFuture readFuture = txChain.newReadWriteTransaction().read(LogicalDatastoreType.OPERATIONAL, path); Futures.addCallback(readFuture, new FutureCallback>() { @Override -- 2.36.6