]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "rgw: use smart pointer for C_Reinitwatch"
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 4 Jan 2016 20:54:33 +0000 (12:54 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 4 Jan 2016 20:54:33 +0000 (12:54 -0800)
This commit introduced regressions, issues #14173, #14180.

The problem is that the context deletes itself after execution,
so using a shared_ptr to hold it is problematic, as we'll eventually
have a double free. Also, it doesn't solve the underlying leak issue.

This reverts commit e9daed221e7c6fd84aef78c3d5fc18470b916fcb.

src/rgw/rgw_rados.cc

index 982d7851ec98b8fbbea99fbdc015dc903a6f6428..3e38e9effefe4d4ef447560c10e4cf25a1ea5aa6 100644 (file)
@@ -1305,7 +1305,6 @@ class RGWWatcher : public librados::WatchCtx2 {
         watcher->reinit();
       }
   };
-  shared_ptr<C_ReinitWatch> reinit_watch;
 public:
   RGWWatcher(RGWRados *r, int i, const string& o) : rados(r), index(i), oid(o), watch_handle(0) {}
   void handle_notify(uint64_t notify_id,
@@ -1326,8 +1325,7 @@ public:
     lderr(rados->ctx()) << "RGWWatcher::handle_error cookie " << cookie
                        << " err " << cpp_strerror(err) << dendl;
     rados->remove_watcher(index);
-    reinit_watch.reset(new C_ReinitWatch(this));
-    rados->schedule_context(reinit_watch.get());
+    rados->schedule_context(new C_ReinitWatch(this));
   }
 
   void reinit() {