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 <rovarga@cisco.com>
// Cohort aware forwarder, which forwards the request to the cohort, giving it a reference to the successor
// connection
final class BouncingReconnectForwarder extends ReconnectForwarder {
// 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;
private static final long serialVersionUID = 1L;
+ CohortNotFoundException(final LocalHistoryIdentifier historyId) {
+ super("Cohort for " + historyId + " not found");
+ }
+
@Override
public boolean isRetriable() {
return false;
}
@Override
public boolean isRetriable() {
return false;
}
+ }
+
+ private static final Logger LOG = LoggerFactory.getLogger(BouncingReconnectForwarder.class);
private final Map<LocalHistoryIdentifier, ProxyReconnectCohort> cohorts;
private final Map<LocalHistoryIdentifier, ProxyReconnectCohort> cohorts;
final ProxyReconnectCohort cohort = cohorts.get(historyId);
if (cohort == null) {
LOG.warn("Cohort for request {} not found, aborting it", request);
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
}
// FIXME: do not use sendRequest() once we have throttling in place, as we have already waited the