From: Radoslaw Zarzynski Date: Wed, 7 Apr 2021 19:49:17 +0000 (+0000) Subject: crimson/osd: improve debugs around Watch / Notify. X-Git-Tag: v17.1.0~2317^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=03d35060d6fd07fcc429e85d4aaa267debb6f168;p=ceph.git crimson/osd: improve debugs around Watch / Notify. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/ops_executer.cc b/src/crimson/osd/ops_executer.cc index fd9731312d31..2dd1d4060bce 100644 --- a/src/crimson/osd/ops_executer.cc +++ b/src/crimson/osd/ops_executer.cc @@ -155,6 +155,7 @@ OpsExecuter::watch_ierrorator::future<> OpsExecuter::do_op_watch_subop_watch( ObjectState& os, ceph::os::Transaction& txn) { + logger().debug("{}", __func__); struct connect_ctx_t { ObjectContext::watch_key_t key; crimson::net::ConnectionRef conn; diff --git a/src/crimson/osd/watch.cc b/src/crimson/osd/watch.cc index ee9308e2858c..cb26d60984aa 100644 --- a/src/crimson/osd/watch.cc +++ b/src/crimson/osd/watch.cc @@ -18,6 +18,11 @@ namespace { namespace crimson::osd { +Watch::~Watch() +{ + logger().debug("{} gid={} cookie={}", __func__, get_watcher_gid(), get_cookie()); +} + seastar::future<> Watch::connect(crimson::net::ConnectionRef conn, bool) { if (this->conn == conn) { @@ -215,6 +220,10 @@ void Notify::do_timeout() // to avoid use-after-free we bump up the ref counter with `guard_ptr`. [[maybe_unused]] auto guard_ptr = shared_from_this(); for (auto& watcher : watchers) { + logger().debug("canceling watcher cookie={} gid={} use_count={}", + watcher->get_cookie(), + watcher->get_watcher_gid(), + watcher->use_count()); watcher->cancel_notify(ninfo.notify_id); } std::ignore = send_completion(std::move(watchers)); diff --git a/src/crimson/osd/watch.h b/src/crimson/osd/watch.h index 4b50d286050f..5ad1f05d898d 100644 --- a/src/crimson/osd/watch.h +++ b/src/crimson/osd/watch.h @@ -55,6 +55,7 @@ public: winfo(winfo), entity_name(entity_name) { } + ~Watch(); seastar::future<> connect(crimson::net::ConnectionRef, bool); bool is_alive() const {