]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
luminous: mgr/MgrClient: Protect daemon_health_metrics 23459/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:51:56 +0000 (11:51 +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)

Conflicts:
src/mgr/MgrClient.cc Function name is different in luminous

src/mgr/MgrClient.cc

index 5614e00d3a060ea1eba1d124e40041edc32f475c..e2e3009a18750c8279470ab1b59bdb6a94da91d0 100644 (file)
@@ -465,5 +465,6 @@ int MgrClient::service_daemon_update_status(
 
 void MgrClient::update_osd_health(std::vector<OSDHealthMetric>&& metrics)
 {
+  Mutex::Locker l(lock);
   osd_health_metrics = std::move(metrics);
 }