From: Matan Breizman Date: Tue, 25 Jul 2023 07:27:33 +0000 (+0000) Subject: ceph_mon: allocate Throttles on stack X-Git-Tag: v18.2.5~687^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=80c77bb518e10dbf03bdc4a285ed4f50b79b9814;p=ceph.git ceph_mon: allocate Throttles on stack Signed-off-by: Matan Breizman (cherry picked from commit 3b5860d9d7e087a55becae584dc00abb28790582) --- diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index 7dfe77768f3..dc89140456b 100644 --- a/src/ceph_mon.cc +++ b/src/ceph_mon.cc @@ -818,20 +818,20 @@ int main(int argc, const char **argv) Messenger::Policy::stateless_server(0)); // throttle client traffic - Throttle *client_throttler = new Throttle(g_ceph_context, "mon_client_bytes", - g_conf()->mon_client_bytes); + Throttle client_throttler(g_ceph_context, "mon_client_bytes", + g_conf()->mon_client_bytes); msgr->set_policy_throttlers(entity_name_t::TYPE_CLIENT, - client_throttler, NULL); + &client_throttler, NULL); // throttle daemon traffic // NOTE: actual usage on the leader may multiply by the number of // monitors if they forward large update messages from daemons. - Throttle *daemon_throttler = new Throttle(g_ceph_context, "mon_daemon_bytes", - g_conf()->mon_daemon_bytes); - msgr->set_policy_throttlers(entity_name_t::TYPE_OSD, daemon_throttler, - NULL); - msgr->set_policy_throttlers(entity_name_t::TYPE_MDS, daemon_throttler, - NULL); + Throttle daemon_throttler(g_ceph_context, "mon_daemon_bytes", + g_conf()->mon_daemon_bytes); + msgr->set_policy_throttlers(entity_name_t::TYPE_OSD, &daemon_throttler, + NULL); + msgr->set_policy_throttlers(entity_name_t::TYPE_MDS, &daemon_throttler, + NULL); entity_addrvec_t bind_addrs = ipaddrs; entity_addrvec_t public_addrs = ipaddrs; @@ -922,8 +922,6 @@ int main(int argc, const char **argv) delete mon; delete msgr; delete mgr_msgr; - delete client_throttler; - delete daemon_throttler; // cd on exit, so that gmon.out (if any) goes into a separate directory for each node. char s[20];