public PersistentMembershipView getResult() { waitForRepliesUninterruptibly(); if (views.isEmpty()) { // TODO prperist internationalize. throw new ReplyException("Member departed"); } return views.iterator().next(); }
protected boolean stillWaitingFromNodes() { if (shutdown) { // Create the exception here, so that the call stack reflects the // failed computation. If you set the exception in onShutdown, // the resulting stack is not of interest. ReplyException re = new ReplyException(new DistributedSystemDisconnectedException( "aborted due to shutdown")); this.exception = re; return false; } // return (numMembers()-this.numMemberDeparted) > 0; return numMembers() > 0; }
/** * To fix the hang of 42951 make sure that everything waiting on this processor are told to quit * waiting * and tell them why. * * @param ex the reason the reply processor is being canceled */ public void cancel(InternalDistributedMember sender, RuntimeException ex) { processException(new ReplyException("Unexpected exception while processing reply message", ex)); removeMember(sender, false); checkIfDone(); } }
synchronized void respondWithException(Throwable t) { try { if (this.response.getException() == null) { this.response.setException(new ReplyException(t)); if (logger.isTraceEnabled(LogMarker.DLS_VERBOSE)) { logger.trace(LogMarker.DLS_VERBOSE, "While processing <{}>, got exception, returning to sender", this, this.response.getException()); } } else { logger.warn(LogMarker.DLS_VERBOSE, String.format("More than one exception thrown in %s", this), t); } } finally { sendResponse(); } }
private void sendFailureReply(int rpId, String exMsg, Throwable ex, boolean directAck) { ReplySender dm = null; if (directAck) { dm = new DirectReplySender(this); } else if (rpId != 0) { dm = this.owner.getDM(); } if (dm != null) { ReplyMessage.send(getRemoteAddress(), rpId, new ReplyException(exMsg, ex), dm); } }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithCauseThatIsNotACancelFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception", new RuntimeException("expected"))) .when(prepareBackupReplyProcessor).waitForReplies(); prepareBackupStep.send(); }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithCauseThatIsNotACancelFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception", new RuntimeException("expected"))) .when(flushToDiskReplyProcessor).waitForReplies(); flushToDiskStep.send(); }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithCauseThatIsNotACancelFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception", new RuntimeException("expected"))) .when(finishBackupReplyProcessor).waitForReplies(); finishBackupStep.send(); }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithCauseThatIsNotACancelFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception", new RuntimeException("expected"))) .when(backupReplyProcessor).waitForReplies(); abortBackupStep.send(); }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithNoCauseFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception")).when(prepareBackupReplyProcessor) .waitForReplies(); prepareBackupStep.send(); }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithNoCauseFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception")).when(backupReplyProcessor).waitForReplies(); abortBackupStep.send(); }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithNoCauseFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception")).when(flushToDiskReplyProcessor) .waitForReplies(); flushToDiskStep.send(); }
@Test(expected = ReplyException.class) public void sendShouldThrowReplyExceptionWithNoCauseFromWaitForReplies() throws Exception { doThrow(new ReplyException("expected exception")).when(finishBackupReplyProcessor) .waitForReplies(); finishBackupStep.send(); }
@Override protected void process(DistributionMessage message, boolean warn) { if (message instanceof AdminFailureResponse) { Exception ex = ((AdminFailureResponse) message).getCause(); if (ex != null) { ReplyException replyException = new ReplyException(ex); replyException.setSenderIfNull(message.getSender()); processException(message, replyException); } } super.process(message, warn); } }
@Test public void sendShouldHandleCancelExceptionFromWaitForReplies() throws Exception { ReplyException replyException = new ReplyException("expected exception", new CacheClosedException("expected exception")); doThrow(replyException).when(prepareBackupReplyProcessor).waitForReplies(); prepareBackupStep.send(); }
@Test public void sendShouldHandleCancelExceptionFromWaitForReplies() throws Exception { ReplyException replyException = new ReplyException("expected exception", new CacheClosedException("expected exception")); doThrow(replyException).when(flushToDiskReplyProcessor).waitForReplies(); flushToDiskStep.send(); }
@Test public void sendShouldHandleCancelExceptionFromWaitForReplies() throws Exception { ReplyException replyException = new ReplyException("expected exception", new CacheClosedException("expected exception")); doThrow(replyException).when(finishBackupReplyProcessor).waitForReplies(); finishBackupStep.send(); }
@Test public void sendShouldHandleCancelExceptionFromWaitForReplies() throws Exception { ReplyException replyException = new ReplyException("expected exception", new CacheClosedException("expected exception")); doThrow(replyException).when(backupReplyProcessor).waitForReplies(); abortBackupStep.send(); }
@Override protected boolean operateOnRegion(ClusterDistributionManager dm, LocalRegion r, long startTime) throws RemoteOperationException { final boolean sendReply; InternalDistributedMember eventSender = getSender(); try { sendReply = doLocalRemoveAll(r, eventSender); } catch (RemoteOperationException e) { sendReply(getSender(), getProcessorId(), dm, new ReplyException(e), r, startTime); return false; } if (sendReply) { sendReply(getSender(), getProcessorId(), dm, null, r, startTime); } return false; }
@Override protected boolean operateOnRegion(ClusterDistributionManager dm, LocalRegion r, long startTime) throws RemoteOperationException { final boolean sendReply; InternalDistributedMember eventSender = getSender(); long lastModified = 0L; try { sendReply = doLocalPutAll(r, eventSender, lastModified); } catch (RemoteOperationException e) { sendReply(getSender(), getProcessorId(), dm, new ReplyException(e), r, startTime); return false; } if (sendReply) { sendReply(getSender(), getProcessorId(), dm, null, r, startTime); } return false; }