From f087b438595a1704d3d85494444f19a33d9ce464 Mon Sep 17 00:00:00 2001 From: "manjunath.hethur" Date: Thu, 16 Jan 2020 16:42:54 +0530 Subject: [PATCH] Synchronizing BGP thrift service delete context. JIRA: NETVIRT-1660 Signed-off-by: manjunath.hethur Change-Id: Iaa7830fefc093624da64de432550484647e851b0 Signed-off-by: manjunath.hethur --- .../bgpmanager/thrift/server/BgpThriftService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/server/BgpThriftService.java b/bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/server/BgpThriftService.java index 9f52b1f98f..1a82205edb 100644 --- a/bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/server/BgpThriftService.java +++ b/bgpmanager/impl/src/main/java/org/opendaylight/netvirt/bgpmanager/thrift/server/BgpThriftService.java @@ -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"); + } } } -- 2.36.6