For some reason in clustered configuration BgpPeer might be instantiated
twice and this leads to service failure, this patch introduce additional
check to avoid this.
JIRA: BGPCEP-948
Change-Id: Icb355abf89ba1dee0281c32d6dd60c95fcdfdb61
Signed-off-by: Oleksii Mozghovyi <oleksii.mozghovyi@pantheon.tech>
@Override
public void close() {
if (this.bgpPeerSingletonService != null) {
+ this.bgpPeerSingletonService.closeServiceInstance();
this.bgpPeerSingletonService = null;
}
if (this.serviceRegistration != null) {
}
synchronized void instantiateServiceInstance() {
+ if (isServiceInstantiated) {
+ LOG.warn("Peer {} has already been instantiated", this.neighborAddress);
+ return;
+ }
this.isServiceInstantiated = true;
LOG.info("Peer instantiated {}", this.neighborAddress);
this.bgpPeer.instantiateServiceInstance();