if (rsp.wasSuspected() || !rsp.wasReceived()) {
if (rsp.wasSuspected()) {
throw new SuspectException("Suspected member: " + rsp.getSender());
} else {
// if we have a response filter then we may not have waited for some nodes!
if (responseFilter == null) throw new TimeoutException("Replication timeout for " + rsp.getSender());
}
} else {
noValidResponses = false;
if (rsp.getValue() != null) {
Response value = (Response) rsp.getValue();
if (value instanceof ExceptionResponse) {
Exception e = ((ExceptionResponse) value).getException();
if (!(e instanceof ReplicationException)) {
// if we have any application-level exceptions make sure we throw them!!
if (trace) log.trace("Recieved exception '{0}' from {1}", e, rsp.getSender());
throw e;
}
}
retval.add(value);
}
}
}
if (noValidResponses) throw new TimeoutException("Timed out waiting for valid responses!");
return retval;
} finally {
// release the "processing" lock so that other threads are aware of the network call having completed
if (unlock) flushTracker.releaseProcessingLock();
}