From: Sage Weil Date: Tue, 29 Jun 2021 22:49:52 +0000 (-0400) Subject: mgr/ActivePyModules: don't take unnecessary lock X-Git-Tag: v17.1.0~1505^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ee6f97b3ed172be98dd429a4aef54de5fb689f7;p=ceph.git mgr/ActivePyModules: don't take unnecessary lock This isn't needed. Signed-off-by: Sage Weil --- diff --git a/src/mgr/ActivePyModules.cc b/src/mgr/ActivePyModules.cc index 58e51e30ad54..a5589062e99d 100644 --- a/src/mgr/ActivePyModules.cc +++ b/src/mgr/ActivePyModules.cc @@ -426,22 +426,20 @@ PyObject *ActivePyModules::get_python(const std::string &what) return f.get(); }); } else if (what == "mgr_ips") { - return cluster_state.with_mgrmap([&](const MgrMap &mgr_map) { - with_gil_t with_gil{no_gil}; - f.open_array_section("ips"); - std::set did; - for (auto& i : server.get_myaddrs().v) { - std::string ip = i.ip_only_to_str(); - if (did.count(ip)) { - continue; - } - did.insert(ip); - f.dump_string("ip", ip); + entity_addrvec_t myaddrs = server.get_myaddrs(); + with_gil_t with_gil{no_gil}; + f.open_array_section("ips"); + std::set did; + for (auto& i : myaddrs.v) { + std::string ip = i.ip_only_to_str(); + if (did.count(ip)) { + continue; } - f.close_section(); - return f.get(); - }); - + did.insert(ip); + f.dump_string("ip", ip); + } + f.close_section(); + return f.get(); } else if (what == "have_local_config_map") { with_gil_t with_gil{no_gil}; f.dump_bool("have_local_config_map", have_local_config_map);