From 16bd45777166c29c433af3b59254a7169e512d98 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 11 Sep 2014 13:46:51 -0700 Subject: [PATCH] ReplicatedPG: cancel cb on blacklisted watcher Fixes: #8315 Backport: firefly Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 1 + src/osd/Watch.h | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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(); -- 2.47.3