nosqlbench-968 Scenario shutdown hook not being unregistered correctly

This commit is contained in:
Jonathan Shook 2023-01-31 23:00:07 -06:00
parent 844ce1c0d8
commit 5a648671d3

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) {