HBASE-11189 Subprocedure should be marked as complete upon failure
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1595357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3f0f2a2bfe
commit
622d55c1b2
@ -246,7 +246,8 @@ public class ProcedureMember implements Closeable {
|
|||||||
", ignoring it.", ee);
|
", ignoring it.", ee);
|
||||||
return; // Procedure has already completed
|
return; // Procedure has already completed
|
||||||
}
|
}
|
||||||
LOG.error("Propagating foreign exception to subprocedure " + sub.getName(), ee);
|
String msg = "Propagating foreign exception to subprocedure " + sub.getName();
|
||||||
sub.monitor.receive(ee);
|
LOG.error(msg, ee);
|
||||||
|
sub.cancel(msg, ee);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,6 +265,7 @@ abstract public class Subprocedure implements Callable<Void> {
|
|||||||
*/
|
*/
|
||||||
public void cancel(String msg, Throwable cause) {
|
public void cancel(String msg, Throwable cause) {
|
||||||
LOG.error(msg, cause);
|
LOG.error(msg, cause);
|
||||||
|
complete = true;
|
||||||
if (cause instanceof ForeignException) {
|
if (cause instanceof ForeignException) {
|
||||||
monitor.receive((ForeignException) cause);
|
monitor.receive((ForeignException) cause);
|
||||||
} else {
|
} else {
|
||||||
|
@ -231,7 +231,7 @@ public class TestZKProcedure {
|
|||||||
final int[] elem = new int[1];
|
final int[] elem = new int[1];
|
||||||
for (int i = 0; i < members.size(); i++) {
|
for (int i = 0; i < members.size(); i++) {
|
||||||
ForeignExceptionDispatcher cohortMonitor = new ForeignExceptionDispatcher();
|
ForeignExceptionDispatcher cohortMonitor = new ForeignExceptionDispatcher();
|
||||||
ProcedureMember comms = members.get(i).getFirst();
|
final ProcedureMember comms = members.get(i).getFirst();
|
||||||
Subprocedure commit = Mockito
|
Subprocedure commit = Mockito
|
||||||
.spy(new SubprocedureImpl(comms, opName, cohortMonitor, WAKE_FREQUENCY, TIMEOUT));
|
.spy(new SubprocedureImpl(comms, opName, cohortMonitor, WAKE_FREQUENCY, TIMEOUT));
|
||||||
// This nasty bit has one of the impls throw a TimeoutException
|
// This nasty bit has one of the impls throw a TimeoutException
|
||||||
@ -245,7 +245,8 @@ public class TestZKProcedure {
|
|||||||
new TimeoutException("subprocTimeout" , 1, 2, 0));
|
new TimeoutException("subprocTimeout" , 1, 2, 0));
|
||||||
Subprocedure r = ((Subprocedure) invocation.getMock());
|
Subprocedure r = ((Subprocedure) invocation.getMock());
|
||||||
LOG.error("Remote commit failure, not propagating error:" + remoteCause);
|
LOG.error("Remote commit failure, not propagating error:" + remoteCause);
|
||||||
r.monitor.receive(remoteCause);
|
comms.receiveAbortProcedure(r.getName(), remoteCause);
|
||||||
|
assertEquals(r.isComplete(), true);
|
||||||
// don't complete the error phase until the coordinator has gotten the error
|
// don't complete the error phase until the coordinator has gotten the error
|
||||||
// notification (which ensures that we never progress past prepare)
|
// notification (which ensures that we never progress past prepare)
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user