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

index b4be4bba3fe1672576188a6329ab70345226f39f..4919f0bf21ff519b373179c14aae36b6b52a3ff2 100644 (file)
@@ -464,7 +464,7 @@ seastar::future<> Client::load_keyring()
 
 void Client::tick()
 {
-  gate.dispatch_in_background(__func__, *this, [this] {
+  gates.dispatch_in_background(__func__, *this, [this] {
     if (active_con) {
       return seastar::when_all_succeed(wait_for_send_log(),
                                        active_con->get_conn()->send_keepalive(),
@@ -505,7 +505,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] {
     // we only care about these message types
     switch (m->get_type()) {
     case CEPH_MSG_MON_MAP:
@@ -538,7 +538,7 @@ Client::ms_dispatch(crimson::net::ConnectionRef conn, MessageRef m)
 
 void Client::ms_handle_reset(crimson::net::ConnectionRef conn, bool /* is_replace */)
 {
-  gate.dispatch_in_background(__func__, *this, [this, conn] {
+  gates.dispatch_in_background(__func__, *this, [this, conn] {
     auto found = std::find_if(pending_conns.begin(), pending_conns.end(),
                              [peer_addr = conn->get_peer_addr()](auto& mc) {
                                return mc->is_my_peer(peer_addr);
@@ -941,7 +941,7 @@ seastar::future<> Client::authenticate()
 seastar::future<> Client::stop()
 {
   logger().info("{}", __func__);
-  auto fut = gate.close();
+  auto fut = gates.close_all();
   timer.cancel();
   ready_to_send = false;
   for (auto& pending_con : pending_conns) {
index 1228ecd0bba2762754225147bf809a345ae67d4c..20c4d0ba1a1c0f3a98b698d43b21ab9fcb860658 100644 (file)
@@ -194,7 +194,7 @@ private:
   std::vector<unsigned> get_random_mons(unsigned n) const;
   seastar::future<> _add_conn(unsigned rank, uint64_t global_id);
   void _finish_auth(const entity_addr_t& peer);
-  crimson::common::Gated gate;
+  crimson::common::gate_per_shard gates;
 
   // messages that are waiting for the active_con to be available
   struct pending_msg_t {