From 7034e37e2b2e7f9776ffccb4809bfb18b709e423 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Tue, 6 Sep 2016 12:03:32 +0200 Subject: HONEYCOMB-78: enable HC restart Includes: - restart script for honeycomb - HONEYCOMBC-78 fix: jVPPRegistry.close() is not invoked in case of VPP restart. That prevents subsequent attempts to establish connection from failing (we cannot invoke vl_client_disconnect_from_vlib before connect_to_vpe on fresh vpp instance). Change-Id: Icf4d6a6a40605ed34d307a0f1405b8804ba5df53 Signed-off-by: Marek Gradzki --- .../main/java/io/fd/honeycomb/vpp/distro/JVppRegistryProvider.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppRegistryProvider.java') diff --git a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppRegistryProvider.java b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppRegistryProvider.java index 8605fa0cc..33756f273 100644 --- a/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppRegistryProvider.java +++ b/vpp-common/minimal-distribution/src/main/java/io/fd/honeycomb/vpp/distro/JVppRegistryProvider.java @@ -18,6 +18,7 @@ package io.fd.honeycomb.vpp.distro; import com.google.inject.Inject; import io.fd.honeycomb.infra.distro.ProviderTrait; +import io.fd.honeycomb.translate.v3po.util.VppStatusListener; import java.io.IOException; import org.openvpp.jvpp.JVppRegistry; import org.openvpp.jvpp.JVppRegistryImpl; @@ -34,6 +35,8 @@ public final class JVppRegistryProvider extends ProviderTrait { @Inject private VppConfigAttributes config; + @Inject + private VppStatusListener vppStatus; @Override protected JVppRegistryImpl create() { @@ -47,6 +50,10 @@ public final class JVppRegistryProvider extends ProviderTrait { @Override public void run() { LOG.info("Disconnecting from VPP"); + if (vppStatus.isDown()) { + LOG.info("VPP is down. JVppRegistry cleanup is not needed. Exiting"); + return; + } try { registry.close(); LOG.info("Successfully disconnected from VPP as {}", config.jvppConnectionName); -- cgit 1.2.3-korg