From: Brad Hubbard Date: Thu, 2 Aug 2018 00:33:42 +0000 (+1000) Subject: mgr/MgrClient: Protect daemon_health_metrics X-Git-Tag: v14.0.1~669^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23404%2Fhead;p=ceph.git mgr/MgrClient: Protect daemon_health_metrics 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 Signed-off-by: Brad Hubbard --- diff --git a/src/mgr/MgrClient.cc b/src/mgr/MgrClient.cc index f1a10f0bd171..06d2810d8277 100644 --- a/src/mgr/MgrClient.cc +++ b/src/mgr/MgrClient.cc @@ -510,6 +510,7 @@ int MgrClient::service_daemon_update_status( void MgrClient::update_daemon_health(std::vector&& metrics) { + Mutex::Locker l(lock); daemon_health_metrics = std::move(metrics); }