Avoid a race during shutdown that can lead to having to wait 120s extra before completeting shutdown sequence.
This would happen because you could lose the signal sent from the stop method. Now you will either notice that is topped, or you will receive the signal.
@@ -766,9 +766,9 @@ namespace {
void
MetricManager::run()
{
+ vespalib::MonitorGuard sync(_waiter);
while (!stopping()) {
time_t currentTime = _timer->getTime();
- vespalib::MonitorGuard sync(_waiter);
time_t next = tick(sync, currentTime);
if (currentTime < next) {
sync.wait((next - currentTime) * 1000);
