Synchronizing BGP thrift service delete context. 65/86965/3
authormanjunath.hethur <manjunath.hethur@gmail.com>
Thu, 16 Jan 2020 11:12:54 +0000 (16:42 +0530)
committerChetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Thu, 27 Feb 2020 06:47:05 +0000 (06:47 +0000)
JIRA: NETVIRT-1660

Signed-off-by: manjunath.hethur <manjunath.hethur@gmail.com>
Change-Id: Iaa7830fefc093624da64de432550484647e851b0
Signed-off-by: manjunath.hethur <manjunath.hethur@gmail.com>
bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/server/BgpThriftService.java

index 9f52b1f98fcd2caf461cd4e98a590b2b5530c098..1a82205edb8f8f0b9b30889aafb1f3f4fa5f9b3c 100644 (file)
@@ -111,12 +111,14 @@ public class BgpThriftService {
 
                     @Override
                     public void deleteContext(ServerContext serverContext, TProtocol input, TProtocol output) {
-                        LOG.info("Bgp thrift server delete context event");
-                        if (oldThriftClientContext == serverContext) {
-                            LOG.info("Bgp thrift server cleanup old context");
-                            oldThriftClientContext = null;
-                        } else {
-                            LOG.info("Bgp thrift server cleanup context");
+                        synchronized (this) {
+                            LOG.info("Bgp thrift server delete context event");
+                            if (oldThriftClientContext == serverContext) {
+                                LOG.info("Bgp thrift server cleanup old context");
+                                oldThriftClientContext = null;
+                            } else {
+                                LOG.info("Bgp thrift server cleanup context");
+                            }
                         }
                     }