diff --git a/src/nvmeof/NVMeofGwMonitorClient.cc b/src/nvmeof/NVMeofGwMonitorClient.cc index fc4358f07d4d7..ce3328aec5167 100644 --- a/src/nvmeof/NVMeofGwMonitorClient.cc +++ b/src/nvmeof/NVMeofGwMonitorClient.cc @@ -43,7 +43,7 @@ NVMeofGwMonitorClient::NVMeofGwMonitorClient(int argc, const char **argv) : client_messenger(Messenger::create(g_ceph_context, "async", entity_name_t::CLIENT(-1), "client", getpid())), objecter{g_ceph_context, client_messenger.get(), &monc, poolctx}, client{client_messenger.get(), &monc, &objecter}, - timer(g_ceph_context, lock), + timer(g_ceph_context, beacon_lock), orig_argc(argc), orig_argv(argv) { @@ -193,7 +193,10 @@ int NVMeofGwMonitorClient::init() client.init(); timer.init(); - tick(); + { + std::lock_guard bl(beacon_lock); + tick(); + } dout(10) << "Complete." << dendl; return 0; @@ -217,7 +220,7 @@ static bool get_gw_state(const char* desc, const std::map map; ceph::mutex lock = ceph::make_mutex("NVMeofGw::lock"); + // allow beacons to be sent independently of handle_nvmeof_gw_map + ceph::mutex beacon_lock = ceph::make_mutex("NVMeofGw::beacon_lock"); SafeTimer timer; int orig_argc;