From: Kefu Chai Date: Sun, 7 Mar 2021 13:32:28 +0000 (+0800) Subject: crimson/osd: cleanup Notify::send_completion() X-Git-Tag: v17.1.0~2705^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=28a3b85ff324f0b7f13609f6666f70a0e22175eb;p=ceph.git crimson/osd: cleanup Notify::send_completion() Notify::send_completion() should just send the completion message. so, move irrelevant code out of Notify::send_completion(). Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/watch.cc b/src/crimson/osd/watch.cc index 261bd18040cb8..8898be8bdf3ab 100644 --- a/src/crimson/osd/watch.cc +++ b/src/crimson/osd/watch.cc @@ -146,6 +146,9 @@ seastar::future<> Notify::remove_watcher(WatchRef watch) [[maybe_unused]] const auto num_removed = watchers.erase(watch); assert(num_removed > 0); if (watchers.empty()) { + complete = true; + [[maybe_unused]] bool was_armed = timeout_timer.cancel(); + assert(was_armed); return send_completion(); } else { return seastar::now(); @@ -173,8 +176,6 @@ seastar::future<> Notify::send_completion( logger().info("{} -- {} in progress watchers, {} timedout watchers {}", __func__, watchers.size(), timedout_watchers.size()); logger().debug("{} sending notify replies: {}", __func__, notify_replies); - complete = true; - timeout_timer.cancel(); ceph::bufferlist empty; auto reply = make_message(