]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: watch error callback invoked on cancelled context 3780/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 24 Feb 2015 00:45:03 +0000 (19:45 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 24 Feb 2015 01:00:43 +0000 (20:00 -0500)
The C_DoWatchError context did not verify whether or not the
watch was cancelled prior to invoking the callback.  This
resulted in sporadic crashes when reconnect errors bubbled
up to destroyed objects.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/osdc/Objecter.cc

index d9e57ecd2dcc3d2a76ba85598e942690fbc1ef76..abcfafbe08ae825e718142e611b352fd7ca65faf 100644 (file)
@@ -491,7 +491,14 @@ struct C_DoWatchError : public Context {
     info->_queued_async();
   }
   void finish(int r) {
-    info->watch_context->handle_error(info->get_cookie(), err);
+    objecter->rwlock.get_read();
+    bool canceled = info->canceled;
+    objecter->rwlock.put_read();
+
+    if (!canceled) {
+      info->watch_context->handle_error(info->get_cookie(), err);
+    }
+
     info->finished_async();
     info->put();
     objecter->_linger_callback_finish();