diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-09-06 12:03:32 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-09-07 13:33:33 +0200 |
commit | 49a8666711f62edf78ed59272a7446899c397922 (patch) | |
tree | d315829bea1545e306fd3c837d089da88b43c80c /v3po/v3po2vpp/src/main | |
parent | e9eda93718d02f64ad25299a887efd976edfae4f (diff) |
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 <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main')
-rw-r--r-- | v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java index ea6b2e460..b379c81d2 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/translate/v3po/VppStateHoneycombReaderFactory.java @@ -25,6 +25,7 @@ import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder; import io.fd.honeycomb.translate.util.read.KeepaliveReaderWrapper; import io.fd.honeycomb.translate.v3po.util.NamingContext; import io.fd.honeycomb.translate.v3po.util.ReadTimeoutException; +import io.fd.honeycomb.translate.v3po.util.VppStatusListener; import io.fd.honeycomb.translate.v3po.vppstate.BridgeDomainCustomizer; import io.fd.honeycomb.translate.v3po.vppstate.L2FibEntryCustomizer; import io.fd.honeycomb.translate.v3po.vppstate.VersionCustomizer; @@ -40,27 +41,26 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomain; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.openvpp.jvpp.core.future.FutureJVppCore; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public final class VppStateHoneycombReaderFactory implements ReaderFactory { - private static final Logger LOG = LoggerFactory.getLogger(VppStateHoneycombReaderFactory.class); - private final FutureJVppCore jVpp; private final NamingContext ifcCtx; private final NamingContext bdCtx; private final ScheduledExecutorService keepaliveExecutor; + private final VppStatusListener vppStatusListener; @Inject public VppStateHoneycombReaderFactory(final FutureJVppCore jVpp, @Named("interface-context") final NamingContext ifcCtx, @Named("bridge-domain-context") final NamingContext bdCtx, - final ScheduledExecutorService keepaliveExecutorDependency) { + final ScheduledExecutorService keepaliveExecutorDependency, + final VppStatusListener vppStatusListener) { this.jVpp = jVpp; this.ifcCtx = ifcCtx; this.bdCtx = bdCtx; this.keepaliveExecutor = keepaliveExecutorDependency; + this.vppStatusListener = vppStatusListener; } @Override @@ -75,9 +75,7 @@ public final class VppStateHoneycombReaderFactory implements ReaderFactory { // is truly generic registry.add(new KeepaliveReaderWrapper<>( new GenericReader<>(vppStateId.child(Version.class), new VersionCustomizer(jVpp)), - keepaliveExecutor, ReadTimeoutException.class, 30, - // FIXME-minimal trigger jvpp reinitialization here - () -> LOG.error("Keepalive failed. VPP is probably DOWN!"))); + keepaliveExecutor, ReadTimeoutException.class, 30, vppStatusListener)); // BridgeDomains(Structural) final InstanceIdentifier<BridgeDomains> bridgeDomainsId = vppStateId.child(BridgeDomains.class); registry.addStructuralReader(bridgeDomainsId, BridgeDomainsBuilder.class); |