diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-05-04 21:25:33 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-05-04 22:24:50 +0000 |
commit | 2b83b031718d466df9fc0c4abd89f7fe0bcdbbf8 (patch) | |
tree | 064bbdb40c3c498e5a7d7b21c9c01ebaa61d41f7 /metrics | |
parent | 2078bee591af22f091e7e9a9d7c039b0fca2be5c (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.
Diffstat (limited to 'metrics')
-rw-r--r-- | metrics/src/vespa/metrics/metricmanager.cpp | 2 |
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); |