Merge pull request #970 from nosqlbench/nosqlbench-968-unhookhook

unregister scenario shutdown hook correctly
This commit is contained in:
Jonathan Shook
2023-02-01 10:59:12 -06:00
committed by GitHub

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 nosqlbench
* Copyright (c) 2022-2023 nosqlbench
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -277,8 +277,10 @@ public class Scenario implements Callable<ExecutionMetricsResult> {
}
Runtime.getRuntime().removeShutdownHook(scenarioShutdownHook);
scenarioShutdownHook.run();
var runHook = scenarioShutdownHook;
scenarioShutdownHook = null;
runHook.run();
logger.debug("removing scenario shutdown hook");
}
public void notifyException(Thread t, Throwable e) {