]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: resolve memory leak of recall gather
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 1 Feb 2019 04:43:42 +0000 (20:43 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 12 Feb 2019 23:06:37 +0000 (15:06 -0800)
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 <pdonnell@redhat.com>
src/mds/MDSRank.cc

index 810eb0b8fa1d4ad4920a4a8c228e449db187d51f..a42121bff5eca4dd1c55ae4b4e2d253b72ffc286 100644 (file)
@@ -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;