Fix CSIT regression due to BGPCEP-878 fix
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / config / BgpPeer.java
index 425023b96ccb4bf5efcc9917547f1c2cd2a3467f..38eb0e86ff69bec7bb9a229ec3e5553734e8d2f1 100644 (file)
@@ -149,6 +149,10 @@ public class BgpPeer implements PeerBean, BGPPeerStateConsumer {
     public synchronized void restart(final RIB rib, final InstanceIdentifier<Bgp> bgpIid,
             final PeerGroupConfigLoader peerGroupLoader, final BGPTableTypeRegistryConsumer tableTypeRegistry) {
         Preconditions.checkState(this.currentConfiguration != null);
+        if (this.bgpPeerSingletonService != null) {
+            this.bgpPeerSingletonService.closeServiceInstance();
+            this.bgpPeerSingletonService = null;
+        }
         start(rib, this.currentConfiguration, bgpIid, peerGroupLoader, tableTypeRegistry);
     }