mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Fix a possible NPE situation caused by unregisterMetrics() if registerMetrics() fails to execute somehow (e.g. CLI input parameter problem such as cycle number < stride number)
This commit is contained in:
@@ -462,8 +462,10 @@ public class ActivityExecutor implements NBLabeledElement, ActivityController, P
|
||||
this.threadsGauge = ActivityMetrics.register(new NBFunctionGauge(activity, () -> (double) this.motors.size(), "threads"));
|
||||
}
|
||||
private void unregisterMetrics() {
|
||||
ActivityMetrics.unregister(this.threadsGauge);
|
||||
this.threadsGauge=null;
|
||||
if (this.threadsGauge != null) {
|
||||
ActivityMetrics.unregister(this.threadsGauge);
|
||||
this.threadsGauge = null;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shutdownExecutorService(int secondsToWait) {
|
||||
|
||||
Reference in New Issue
Block a user