summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-05-04 21:25:33 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-05-04 22:24:50 +0000
commit2b83b031718d466df9fc0c4abd89f7fe0bcdbbf8 (patch)
tree064bbdb40c3c498e5a7d7b21c9c01ebaa61d41f7
parent2078bee591af22f091e7e9a9d7c039b0fca2be5c (diff)
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.
-rw-r--r--metrics/src/vespa/metrics/metricmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/metrics/src/vespa/metrics/metricmanager.cpp b/metrics/src/vespa/metrics/metricmanager.cpp
index c330bf04d56..04f7568bfba 100644
--- a/metrics/src/vespa/metrics/metricmanager.cpp
+++ b/metrics/src/vespa/metrics/metricmanager.cpp
@@ -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);