diff options
author | Nitzan Mordechai <nmordech@redhat.com> | 2024-09-17 14:23:10 +0200 |
---|---|---|
committer | Nitzan Mordechai <nmordech@redhat.com> | 2024-09-17 14:26:49 +0200 |
commit | da409bb22cee838954a92ee7a3d05fc4e4b1d435 (patch) | |
tree | e99acd42606815cc7fe8999b633b3626c883387a /src | |
parent | common/gated: enable ceph_assert on shard id (diff) | |
download | ceph-da409bb22cee838954a92ee7a3d05fc4e4b1d435.tar.xz ceph-da409bb22cee838954a92ee7a3d05fc4e4b1d435.zip |
crimson/mgr/client: use gates to handle multi-shards
Fixes: https://tracker.ceph.com/issues/67773
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | src/crimson/mgr/client.cc | 12 | ||||
-rw-r--r-- | src/crimson/mgr/client.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/crimson/mgr/client.cc b/src/crimson/mgr/client.cc index 69a69bfddf5..3326753ca2e 100644 --- a/src/crimson/mgr/client.cc +++ b/src/crimson/mgr/client.cc @@ -41,7 +41,7 @@ seastar::future<> Client::stop() { logger().info("{}", __func__); report_timer.cancel(); - auto fut = gate.close(); + auto fut = gates.close_all(); if (conn) { conn->mark_down(); } @@ -52,7 +52,7 @@ std::optional<seastar::future<>> Client::ms_dispatch(crimson::net::ConnectionRef conn, MessageRef m) { bool dispatched = true; - gate.dispatch_in_background(__func__, *this, [this, conn, &m, &dispatched] { + gates.dispatch_in_background(__func__, *this, [this, conn, &m, &dispatched] { switch(m->get_type()) { case MSG_MGR_MAP: return handle_mgr_map(conn, boost::static_pointer_cast<MMgrMap>(m)); @@ -71,7 +71,7 @@ void Client::ms_handle_connect( seastar::shard_id prv_shard) { ceph_assert_always(prv_shard == seastar::this_shard_id()); - gate.dispatch_in_background(__func__, *this, [this, c] { + gates.dispatch_in_background(__func__, *this, [this, c] { if (conn == c) { // ask for the mgrconfigure message auto m = crimson::make_message<MMgrOpen>(); @@ -87,7 +87,7 @@ void Client::ms_handle_connect( void Client::ms_handle_reset(crimson::net::ConnectionRef c, bool /* is_replace */) { - gate.dispatch_in_background(__func__, *this, [this, c] { + gates.dispatch_in_background(__func__, *this, [this, c] { if (conn == c) { report_timer.cancel(); return reconnect(); @@ -158,7 +158,7 @@ seastar::future<> Client::handle_mgr_conf(crimson::net::ConnectionRef, void Client::report() { _send_report(); - gate.dispatch_in_background(__func__, *this, [this] { + gates.dispatch_in_background(__func__, *this, [this] { if (!conn) { logger().warn("report: no conn available; report skipped"); return seastar::now(); @@ -178,7 +178,7 @@ void Client::_send_report() { // TODO: implement daemon_health_metrics support // https://tracker.ceph.com/issues/63766 - gate.dispatch_in_background(__func__, *this, [this] { + gates.dispatch_in_background(__func__, *this, [this] { if (!conn) { logger().warn("cannot send report; no conn available"); return seastar::now(); diff --git a/src/crimson/mgr/client.h b/src/crimson/mgr/client.h index 7f4e62fd7d2..ae489644eaa 100644 --- a/src/crimson/mgr/client.h +++ b/src/crimson/mgr/client.h @@ -55,7 +55,7 @@ private: WithStats& with_stats; crimson::net::ConnectionRef conn; seastar::timer<seastar::lowres_clock> report_timer; - crimson::common::Gated gate; + crimson::common::gate_per_shard gates; uint64_t last_config_bl_version = 0; std::string service_name, daemon_name; |