]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/mon/MonClient: imitate Classic's _check_auth_tickets
authorMatan Breizman <mbreizma@redhat.com>
Wed, 11 Jun 2025 09:34:30 +0000 (09:34 +0000)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 29 Dec 2025 22:29:59 +0000 (17:29 -0500)
Imitating this interface from Classicals MonClient::_check_auth_tickets()
should make it easier to understand Crimson's counterpart.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/crimson/mon/MonClient.cc
src/crimson/mon/MonClient.h

index 0d7185f633782aa37cc5d70d23db3da095e085b6..9123b6bf2d74ce6cd281e813db5e090c7b61dd44 100644 (file)
@@ -464,14 +464,22 @@ seastar::future<> Client::load_keyring()
   }
 }
 
+seastar::future<> Client::_check_auth_tickets()
+{
+  return seastar::when_all_succeed(
+    active_con->renew_tickets(),
+    active_con->renew_rotating_keyring()).then_unpack([] {
+      logger().info("_check_auth_tickets: renewed tickets");
+  });
+}
+
 void Client::tick()
 {
   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(),
-                                       active_con->renew_tickets(),
-                                       active_con->renew_rotating_keyring()).discard_result();
+                                       _check_auth_tickets()).discard_result();
     } else {
       assert(is_hunting());
       logger().info("{} continuing the hunt", __func__);
@@ -793,11 +801,7 @@ seastar::future<> Client::handle_monmap(crimson::net::Connection &conn,
   if (monmap.get_addr_name(peer_addr, cur_mon)) {
     if (active_con) {
       logger().info("handle_monmap: renewing tickets");
-      return seastar::when_all_succeed(
-       active_con->renew_tickets(),
-       active_con->renew_rotating_keyring()).then_unpack([] {
-         logger().info("handle_mon_map: renewed tickets");
-       });
+      return _check_auth_tickets();
     } else {
       return seastar::now();
     }
@@ -826,9 +830,7 @@ seastar::future<> Client::handle_auth_reply(crimson::net::Connection &conn,
     return (*found)->handle_auth_reply(m);
   } else if (active_con) {
     return active_con->handle_auth_reply(m).then([this] {
-      return seastar::when_all_succeed(
-        active_con->renew_rotating_keyring(),
-        active_con->renew_tickets()).discard_result();
+      return _check_auth_tickets();
     });
   } else {
     logger().error("unknown auth reply from {}", conn.get_peer_addr());
index 0fea3f37f0238a0d17a702ced4972d1b630db434..d2cfa3432bef191f1297617b0a7c3bccf14d8016 100644 (file)
@@ -165,6 +165,8 @@ private:
                             const std::vector<uint32_t>& allowed_modes) final;
 
 private:
+  seastar::future<> _check_auth_tickets();
+
   void tick();
 
   std::optional<seastar::future<>> ms_dispatch(crimson::net::ConnectionRef conn,