]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mimic: mgr/MgrClient: Protect daemon_health_metrics 23458/head
authorBrad Hubbard <bhubbard@redhat.com>
Thu, 2 Aug 2018 00:33:42 +0000 (10:33 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Tue, 7 Aug 2018 01:34:14 +0000 (11:34 +1000)
Without holding the lock update_daemon_health() can race with
send_report() corrupting the daemon_health_metrics vector.

Fixes: http://tracker.ceph.com/issues/23352
Signed-off-by: Kjetil Joergensen <kjetil@medallia.com>
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit 4996506a6b4ab309110039ea29a075f14d09a379)

src/mgr/MgrClient.cc

index 804c9d639e712cabaecb03b60be539057e93884d..04b774796c9712cc3720309b8b4da5f9e778be34 100644 (file)
@@ -512,6 +512,7 @@ int MgrClient::service_daemon_update_status(
 
 void MgrClient::update_daemon_health(std::vector<DaemonHealthMetric>&& metrics)
 {
+  Mutex::Locker l(lock);
   daemon_health_metrics = std::move(metrics);
 }