]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrClient: Protect daemon_health_metrics 23404/head
authorBrad Hubbard <bhubbard@redhat.com>
Thu, 2 Aug 2018 00:33:42 +0000 (10:33 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Thu, 2 Aug 2018 21:44:02 +0000 (07:44 +1000)
Without holiding 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>
src/mgr/MgrClient.cc

index f1a10f0bd1713a8576273e942517128515320157..06d2810d82771b3f8673ed3b51e183f97b6ef815 100644 (file)
@@ -510,6 +510,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);
 }