]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/mgr/client: use gates to handle multi-shards
authorNitzan Mordechai <nmordech@redhat.com>
Tue, 17 Sep 2024 12:23:10 +0000 (12:23 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Tue, 17 Sep 2024 12:26:49 +0000 (12:26 +0000)
Fixes: https://tracker.ceph.com/issues/67773
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
src/crimson/mgr/client.cc
src/crimson/mgr/client.h

index 69a69bfddf55317d14dd07b3115b872bca664326..3326753ca2ef987f79ff92ae401e0c0a73306081 100644 (file)
@@ -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();
index 7f4e62fd7d2d3630594b8b6a3facd845d4edd1c6..ae489644eaa63efdfd2eb1ab0991319912d1f013 100644 (file)
@@ -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;