mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Merge pull request #988 from nosqlbench/nosqlbench-987-statemodel
fixes for missing errored state in activity
This commit is contained in:
commit
fdb07bf84f
@ -106,7 +106,7 @@ public enum RunState {
|
|||||||
case Stopping, Finished, Errored -> true;// A motor has exhausted its input, and is finished with its work
|
case Stopping, Finished, Errored -> true;// A motor has exhausted its input, and is finished with its work
|
||||||
default -> false;
|
default -> false;
|
||||||
};
|
};
|
||||||
case Stopping -> (target == Stopped||target==Finished); // A motor was stopped by request before exhausting input
|
case Stopping -> (target == Stopped||target==Finished||target==Errored); // A motor was stopped by request before exhausting input
|
||||||
case Finished -> (target == Running); // A motor was restarted?
|
case Finished -> (target == Running); // A motor was restarted?
|
||||||
case Errored -> target==Errored;
|
case Errored -> target==Errored;
|
||||||
};
|
};
|
||||||
|
@ -87,10 +87,10 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
|
|||||||
|
|
||||||
activity.setRunState(RunState.Stopping);
|
activity.setRunState(RunState.Stopping);
|
||||||
motors.forEach(Motor::requestStop);
|
motors.forEach(Motor::requestStop);
|
||||||
tally.awaitNoneOther(RunState.Stopped, RunState.Finished);
|
tally.awaitNoneOther(RunState.Stopped, RunState.Finished, RunState.Errored);
|
||||||
|
|
||||||
shutdownExecutorService(Integer.MAX_VALUE);
|
shutdownExecutorService(Integer.MAX_VALUE);
|
||||||
tally.awaitNoneOther(RunState.Stopped, RunState.Finished);
|
tally.awaitNoneOther(RunState.Stopped, RunState.Finished, RunState.Errored);
|
||||||
activity.setRunState(RunState.Stopped);
|
activity.setRunState(RunState.Stopped);
|
||||||
|
|
||||||
logger.info(() -> "stopped: " + this.getActivityDef().getAlias() + " with " + motors.size() + " slots");
|
logger.info(() -> "stopped: " + this.getActivityDef().getAlias() + " with " + motors.size() + " slots");
|
||||||
@ -349,7 +349,7 @@ public class ActivityExecutor implements ActivityController, ParameterMap.Listen
|
|||||||
return activity;
|
return activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void notifyException(Thread t, Throwable e) {
|
public synchronized void notifyException(Thread t, Throwable e) {
|
||||||
logger.debug(() -> "Uncaught exception in activity thread forwarded to activity executor: " + e.getMessage());
|
logger.debug(() -> "Uncaught exception in activity thread forwarded to activity executor: " + e.getMessage());
|
||||||
this.exception = new RuntimeException("Error in activity thread " + t.getName(), e);
|
this.exception = new RuntimeException("Error in activity thread " + t.getName(), e);
|
||||||
this.requestStopMotors();
|
this.requestStopMotors();
|
||||||
|
Loading…
Reference in New Issue
Block a user