mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Merge pull request #931 from nosqlbench/nosqlbench-930-errormsg
replace missing cancelation for shutdown hook
This commit is contained in:
@@ -278,6 +278,7 @@ public class Scenario implements Callable<ExecutionMetricsResult> {
|
|||||||
|
|
||||||
Runtime.getRuntime().removeShutdownHook(scenarioShutdownHook);
|
Runtime.getRuntime().removeShutdownHook(scenarioShutdownHook);
|
||||||
scenarioShutdownHook.run();
|
scenarioShutdownHook.run();
|
||||||
|
scenarioShutdownHook = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void notifyException(Thread t, Throwable e) {
|
public void notifyException(Thread t, Throwable e) {
|
||||||
@@ -339,7 +340,7 @@ public class Scenario implements Callable<ExecutionMetricsResult> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finish() {
|
public synchronized void finish() {
|
||||||
logger.debug("finishing scenario");
|
logger.debug("finishing scenario");
|
||||||
endedAtMillis = System.currentTimeMillis(); //TODO: Make only one endedAtMillis assignment
|
endedAtMillis = System.currentTimeMillis(); //TODO: Make only one endedAtMillis assignment
|
||||||
if (this.state == State.Running) {
|
if (this.state == State.Running) {
|
||||||
@@ -351,6 +352,8 @@ public class Scenario implements Callable<ExecutionMetricsResult> {
|
|||||||
// that the scenario was ended before the hook was uninstalled normally.
|
// that the scenario was ended before the hook was uninstalled normally.
|
||||||
this.state = State.Interrupted;
|
this.state = State.Interrupted;
|
||||||
logger.warn("Scenario was interrupted by process exit, shutting down");
|
logger.warn("Scenario was interrupted by process exit, shutting down");
|
||||||
|
} else {
|
||||||
|
logger.info("Scenario completed successfully, with " + scenarioController.getActivityExecutorMap().size() + " logical activities.");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(() -> "scenario state: " + this.state);
|
logger.info(() -> "scenario state: " + this.state);
|
||||||
|
|||||||
Reference in New Issue
Block a user