mirror of
https://github.com/ceph/ceph
synced 2025-01-20 10:01:45 +00:00
crimson/osd: capture watcher when calling its member function
otherwise the extracted node handler will be destroyed, and so does the watcher enclosed in it. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
34b78df480
commit
18ce15ab5e
@ -210,11 +210,13 @@ OpsExecuter::watch_errorator::future<> OpsExecuter::do_op_watch_subop_unwatch(
|
||||
},
|
||||
[] (auto&& ctx, ObjectContextRef obc) {
|
||||
if (auto nh = obc->watchers.extract(ctx.key); !nh.empty()) {
|
||||
logger().info("op_effect: disconnect watcher {}", ctx.key);
|
||||
return nh.mapped()->remove(ctx.send_disconnect);
|
||||
return seastar::do_with(std::move(nh.mapped()),
|
||||
[ctx](auto&& watcher) {
|
||||
logger().info("op_effect: disconnect watcher {}", ctx.key);
|
||||
return watcher->remove(ctx.send_disconnect);
|
||||
});
|
||||
} else {
|
||||
logger().info("op_effect: disconnect failed to find watcher {}",
|
||||
ctx.key);
|
||||
logger().info("op_effect: disconnect failed to find watcher {}", ctx.key);
|
||||
return seastar::now();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user