From: Patrick Donnelly Date: Fri, 1 Feb 2019 04:43:42 +0000 (-0800) Subject: mds: resolve memory leak of recall gather X-Git-Tag: v14.1.0~105^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d8000a556a3390317fb4eca0621cf36ff2e5eb82;p=ceph-ci.git mds: resolve memory leak of recall gather Small change in behavior: after all clients respond to session flush, immediate begin next recall instead of waiting a whole second. Fixes: http://tracker.ceph.com/issues/38137 Signed-off-by: Patrick Donnelly --- diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 810eb0b8fa1..a42121bff5e 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -326,10 +326,13 @@ private: caps_recalled += count; if ((throttled || count > 0) && (recall_timeout == 0 || duration < recall_timeout)) { - auto timer = new FunctionContext([this](int _) { - recall_client_state(); - }); - mds->timer.add_event_after(1.0, timer); + C_ContextTimeout *ctx = new C_ContextTimeout( + mds, 1, new FunctionContext([this](int r) { + recall_client_state(); + })); + ctx->start_timer(); + gather->set_finisher(new MDSInternalContextWrapper(mds, ctx)); + gather->activate(); } else { if (!gather->has_subs()) { delete gather;