From: Samuel Just Date: Thu, 11 Sep 2014 20:46:51 +0000 (-0700) Subject: ReplicatedPG: cancel cb on blacklisted watcher X-Git-Tag: v0.86~58^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=16bd45777166c29c433af3b59254a7169e512d98;p=ceph.git ReplicatedPG: cancel cb on blacklisted watcher Fixes: #8315 Backport: firefly Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 615eaa358697..6d073755889a 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -7179,6 +7179,7 @@ void ReplicatedPG::check_blacklisted_obc_watchers(ObjectContextRef obc) if (get_osdmap()->is_blacklisted(ea)) { dout(10) << "watch: Found blacklisted watcher for " << ea << dendl; assert(j->second->get_pg() == this); + j->second->unregister_cb(); handle_watch_timeout(j->second); } } diff --git a/src/osd/Watch.h b/src/osd/Watch.h index ceae6ad0edc3..152ea951cd2a 100644 --- a/src/osd/Watch.h +++ b/src/osd/Watch.h @@ -99,6 +99,7 @@ class Notify { /// removes the timeout callback, called on completion or cancellation void unregister_cb(); public: + string gen_dbg_prefix() { stringstream ss; ss << "Notify(" << make_pair(cookie, notify_id) << " " @@ -173,15 +174,15 @@ class Watch { /// Registers the timeout callback with watch_timer void register_cb(); - /// Unregisters the timeout callback - void unregister_cb(); - /// send a Notify message when connected for notif void send_notify(NotifyRef notif); /// Cleans up state on discard or remove (including Connection state, obc) void discard_state(); public: + /// Unregisters the timeout callback + void unregister_cb(); + /// NOTE: must be called with pg lock held ~Watch();