]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/crimson: print conn instead of its address
authorKefu Chai <tchaikov@gmail.com>
Thu, 15 Dec 2022 09:38:07 +0000 (17:38 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 16 Dec 2022 02:37:25 +0000 (10:37 +0800)
now that crimson::net::Connection can be formatted using fmt::format(),
instead of printing the pointer, let's print its value.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/test/crimson/test_messenger.cc
src/test/crimson/test_messenger_thrash.cc

index b8cde621689586b3f313e06291828e8cdee93565..a0b982645e8cfe890df2b9fa31f4c9809abacd86 100644 (file)
@@ -985,7 +985,7 @@ class FailoverSuite : public Dispatcher {
           throw std::runtime_error(fmt::format(
                 "The connected connection [{}] {} doesn't"
                 " match the tracked connection [{}] {}",
-                result.index, *result.conn, tracked_index, tracked_conn));
+                result.index, *result.conn, tracked_index, *tracked_conn));
         }
         if (pending_send == 0 && pending_peer_receive == 0 && pending_receive == 0) {
           result.state = conn_state_t::established;
@@ -1574,7 +1574,7 @@ class FailoverTestPeer : public Dispatcher {
       break;
      }
      default:
-      logger().error("{} got unexpected msg from cmd client: {}", *c, m);
+      logger().error("{} got unexpected msg from cmd client: {}", *c, *m);
       ceph_abort();
     }
     return {seastar::now()};
index 2806cc630e2b8f67068c53a35ab4052554e2279e..d56da0a86e83a804fcdec517e50826135ec4c040 100644 (file)
@@ -107,7 +107,7 @@ class SyntheticDispatcher final
   std::optional<seastar::future<>> ms_dispatch(crimson::net::ConnectionRef con,
                                                MessageRef m) {
     if (verbose) {
-      logger().warn("{}: con = {}", __func__, con);
+      logger().warn("{}: con = {}", __func__, *con);
     }
     // MSG_COMMAND is used to disorganize regular message flow
     if (m->get_type() == MSG_COMMAND) {
@@ -119,7 +119,7 @@ class SyntheticDispatcher final
     decode(pl, p);
     if (pl.who == Payload::PING) {
       logger().info(" {} conn= {} {}", __func__,
-        m->get_connection(), pl);
+        *m->get_connection(), pl);
       return reply_message(m, pl);
     } else {
       ceph_assert(pl.who == Payload::PONG);
@@ -137,11 +137,11 @@ class SyntheticDispatcher final
   }
 
   void ms_handle_accept(crimson::net::ConnectionRef conn) {
-    logger().info("{} - Connection:{}", __func__, conn);
+    logger().info("{} - Connection:{}", __func__, *conn);
   }
 
   void ms_handle_connect(crimson::net::ConnectionRef conn) {
-    logger().info("{} - Connection:{}", __func__, conn);
+    logger().info("{} - Connection:{}", __func__, *conn);
   }
 
   void ms_handle_reset(crimson::net::ConnectionRef con, bool is_replace);
@@ -173,7 +173,7 @@ class SyntheticDispatcher final
     sent[pl.seq] = pl.data;
     conn_sent[&*con].push_back(pl.seq);
     logger().info("{} conn= {} send i= {}",
-      __func__, con, pl.seq);
+      __func__, *con, pl.seq);
 
     return con->send(std::move(m));
   }