From: Robert Varga Date: Mon, 5 Dec 2016 17:35:54 +0000 (+0100) Subject: BUG-5280: report history which was not found X-Git-Tag: release/carbon~365 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=61d4d322740f116d7d8ec91b8ba2e4eed409d7d7 BUG-5280: report history which was not found We seem to have a lockign issue somewhere, which leads to an exception being thrown in tests. Refactor the exception to also include history identifier, so we can track it down. Change-Id: I0826dfdc18f10103da58855bb14c269734ae47ab Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java index c6564b66fb..3136023204 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/BouncingReconnectForwarder.java @@ -26,16 +26,20 @@ import org.slf4j.LoggerFactory; // Cohort aware forwarder, which forwards the request to the cohort, giving it a reference to the successor // connection final class BouncingReconnectForwarder extends ReconnectForwarder { - private static final Logger LOG = LoggerFactory.getLogger(BouncingReconnectForwarder.class); - - private static final RequestException FAILED_TO_REPLAY_EXCEPTION = new RequestException("Cohort not found") { + private static final class CohortNotFoundException extends RequestException { private static final long serialVersionUID = 1L; + CohortNotFoundException(final LocalHistoryIdentifier historyId) { + super("Cohort for " + historyId + " not found"); + } + @Override public boolean isRetriable() { return false; } - }; + } + + private static final Logger LOG = LoggerFactory.getLogger(BouncingReconnectForwarder.class); private final Map cohorts; @@ -69,7 +73,7 @@ final class BouncingReconnectForwarder extends ReconnectForwarder { final ProxyReconnectCohort cohort = cohorts.get(historyId); if (cohort == null) { LOG.warn("Cohort for request {} not found, aborting it", request); - throw FAILED_TO_REPLAY_EXCEPTION; + throw new CohortNotFoundException(historyId); } // FIXME: do not use sendRequest() once we have throttling in place, as we have already waited the