BUG 9003: Fix port chain event triggered two times 11/61711/4
authorJaime Caamaño Ruiz <jaime.caamano.ruiz@ericsson.com>
Mon, 14 Aug 2017 17:46:29 +0000 (19:46 +0200)
committerJaime Caamaño Ruiz <jaime.caamano.ruiz@ericsson.com>
Thu, 17 Aug 2017 10:03:51 +0000 (10:03 +0000)
Change-Id: I4dd83824808d3faa2f515901d9171bb8e812d681
Signed-off-by: Jaime Caamaño Ruiz <jaime.caamano.ruiz@ericsson.com>
vpnservice/sfc/translator/src/main/java/org/opendaylight/netvirt/sfc/translator/portchain/NeutronPortChainListener.java

index b23a6027175aa4aff2e1f83a9ef16f51ed9885d7..994737847ac6052545eec1050bbb5d00afc145f4 100644 (file)
@@ -14,8 +14,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.ThreadFactory;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import java.util.concurrent.Future;
 import java.util.concurrent.ThreadFactory;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
@@ -60,7 +58,6 @@ public class NeutronPortChainListener extends DelegatingDataTreeListener<PortCha
 
     private static final InstanceIdentifier<PortChain> PORT_CHAIN_IID =
             InstanceIdentifier.create(Neutron.class).child(PortChains.class).child(PortChain.class);
 
     private static final InstanceIdentifier<PortChain> PORT_CHAIN_IID =
             InstanceIdentifier.create(Neutron.class).child(PortChains.class).child(PortChain.class);
-    private final ExecutorService eventProcessor;
     private final SfcMdsalHelper sfcMdsalHelper;
     private final NeutronMdsalHelper neutronMdsalHelper;
     private final OvsdbMdsalHelper ovsdbMdsalHelper;
     private final SfcMdsalHelper sfcMdsalHelper;
     private final NeutronMdsalHelper neutronMdsalHelper;
     private final OvsdbMdsalHelper ovsdbMdsalHelper;
@@ -73,7 +70,6 @@ public class NeutronPortChainListener extends DelegatingDataTreeListener<PortCha
         this.ovsdbMdsalHelper = new OvsdbMdsalHelper(db);
         this.rspService = rspService;
         ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("Port-Chain-Event-Processor").build();
         this.ovsdbMdsalHelper = new OvsdbMdsalHelper(db);
         this.rspService = rspService;
         ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("Port-Chain-Event-Processor").build();
-        this.eventProcessor = Executors.newSingleThreadExecutor(threadFactory);
     }
 
     /**
     }
 
     /**
@@ -119,7 +115,6 @@ public class NeutronPortChainListener extends DelegatingDataTreeListener<PortCha
     @Override
     public void add(final InstanceIdentifier<PortChain> path, final PortChain newPortChain) {
         processPortChain(newPortChain);
     @Override
     public void add(final InstanceIdentifier<PortChain> path, final PortChain newPortChain) {
         processPortChain(newPortChain);
-        eventProcessor.submit(() -> processPortChain(newPortChain));
     }
 
     private void processPortChain(PortChain newPortChain) {
     }
 
     private void processPortChain(PortChain newPortChain) {