]> git.apps.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, 13 Oct 2025 23:59:39 +0000 (19:59 -0400)
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>
(cherry picked from commit 51fd62a5d6f40fb9f02530d1ee3304085d9942c0)

src/crimson/mon/MonClient.cc
src/crimson/mon/MonClient.h

index 11658ad1c0cdc1ebef1a7567556a953d0e39d1b1..aedbce1163ce99485f2aadd0293a494801b9faf7 100644 (file)
@@ -462,14 +462,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()
 {
   gate.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__);
@@ -791,11 +799,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();
     }
@@ -824,9 +828,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 0a37f587a0f239e88392bbeb2d3006ba2ece8da7..cc17030e0686c46ec7f1742072ed6ba0920f20ed 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,