From d3978c6d0e4f3a453435b695a461bf2808016b60 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 1 May 2021 00:25:18 +0300 Subject: [PATCH] Do not print RDMA connection messages when log_level=0 By the way, it's 1 by default in the OSD, so these messages will still be there in OSD logs --- src/messenger.cpp | 5 ++++- src/msgr_send.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/messenger.cpp b/src/messenger.cpp index 5578a368..59dc0c21 100644 --- a/src/messenger.cpp +++ b/src/messenger.cpp @@ -463,7 +463,10 @@ void osd_messenger_t::check_peer_config(osd_client_t *cl) { cl->rdma_conn->max_msg = server_max_msg; } - printf("Connected to OSD %lu using RDMA\n", cl->osd_num); + if (log_level > 0) + { + printf("Connected to OSD %lu using RDMA\n", cl->osd_num); + } cl->peer_state = PEER_RDMA; tfd->set_fd_handler(cl->peer_fd, false, NULL); // Add the initial receive request diff --git a/src/msgr_send.cpp b/src/msgr_send.cpp index cd06c4ec..972ec0bd 100644 --- a/src/msgr_send.cpp +++ b/src/msgr_send.cpp @@ -272,7 +272,10 @@ void osd_messenger_t::handle_send(int result, osd_client_t *cl) { // FIXME: Do something better than just forgetting the FD // FIXME: Ignore pings during RDMA state transition - printf("Successfully connected with client %d using RDMA\n", cl->peer_fd); + if (log_level > 0) + { + printf("Successfully connected with client %d using RDMA\n", cl->peer_fd); + } cl->peer_state = PEER_RDMA; tfd->set_fd_handler(cl->peer_fd, false, NULL); // Add the initial receive request