]> 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, 22 Sep 2025 16:34:43 +0000 (12:34 -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 a96d7a7c1881606f901ccd71a080a4d972fc8457..a98815383de6253d34520fd8bd89ba1ceb3d8e3f 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__);
@@ -785,11 +793,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();
     }
@@ -818,9 +822,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 087d24c352e3174817ada9adc73f7f317d4b99c0..102bb182942373152f958d75c6068e62247f047a 100644 (file)
@@ -164,6 +164,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,