From c862be649ac5c9bf9d3fabe4ebcbc2ca7b1508c9 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Mon, 21 Jun 2021 12:28:52 +0000 Subject: [PATCH] crimson/osd: introduce more asserts to the Watch timeout handling. Signed-off-by: Radoslaw Zarzynski --- src/crimson/osd/ops_executer.cc | 1 + src/crimson/osd/watch.cc | 1 + src/crimson/osd/watch.h | 1 + 3 files changed, 3 insertions(+) diff --git a/src/crimson/osd/ops_executer.cc b/src/crimson/osd/ops_executer.cc index 98f62b337d340..4bc876c00baa3 100644 --- a/src/crimson/osd/ops_executer.cc +++ b/src/crimson/osd/ops_executer.cc @@ -181,6 +181,7 @@ OpsExecuter::watch_ierrorator::future<> OpsExecuter::do_op_watch_subop_watch( return seastar::now(); }, [] (auto&& ctx, ObjectContextRef obc, Ref pg) { + assert(pg); auto [it, emplaced] = obc->watchers.try_emplace(ctx.key, nullptr); if (emplaced) { const auto& [cookie, entity] = ctx.key; diff --git a/src/crimson/osd/watch.cc b/src/crimson/osd/watch.cc index 5657a8aeae215..1848869d19b74 100644 --- a/src/crimson/osd/watch.cc +++ b/src/crimson/osd/watch.cc @@ -182,6 +182,7 @@ void Watch::cancel_notify(const uint64_t notify_id) void Watch::do_watch_timeout(Ref pg) { + assert(pg); auto [op, fut] = pg->get_shard_services().start_operation( shared_from_this(), pg); std::ignore = std::move(fut).then([op=std::move(op), this] { diff --git a/src/crimson/osd/watch.h b/src/crimson/osd/watch.h index 24d4d315accca..f32904cb1ffc7 100644 --- a/src/crimson/osd/watch.h +++ b/src/crimson/osd/watch.h @@ -61,6 +61,7 @@ public: winfo(winfo), entity_name(entity_name), timeout_timer([this, pg=std::move(pg)] { + assert(pg); return do_watch_timeout(pg); }) { } -- 2.47.3