From 03d35060d6fd07fcc429e85d4aaa267debb6f168 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Wed, 7 Apr 2021 19:49:17 +0000 Subject: [PATCH] crimson/osd: improve debugs around Watch / Notify. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/ops_executer.cc | 1 + src/crimson/osd/watch.cc | 9 +++++++++ src/crimson/osd/watch.h | 1 + 3 files changed, 11 insertions(+) diff --git a/src/crimson/osd/ops_executer.cc b/src/crimson/osd/ops_executer.cc index fd9731312d312..2dd1d4060bce5 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 ee9308e2858c2..cb26d60984aa0 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 4b50d286050f2..5ad1f05d898d6 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 { -- 2.39.5