From 06c602110c0743d65157586fb0dc35ce1d65a4c2 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 14 Dec 2025 17:15:16 +0300 Subject: [PATCH] Change "BUG" short send message to a client disconnection --- src/client/msgr_send.cpp | 6 ++++-- src/client/msgr_stop.cpp | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/client/msgr_send.cpp b/src/client/msgr_send.cpp index 92da6980..99ca9bc8 100644 --- a/src/client/msgr_send.cpp +++ b/src/client/msgr_send.cpp @@ -326,8 +326,10 @@ void osd_messenger_t::handle_send(int result, bool prev, bool more, osd_client_t int expected = cl->send_list.size() < IOV_MAX ? cl->send_list.size() : IOV_MAX; if (done != expected) { - fprintf(stderr, "BUG (maybe kernel): Expected to send %d iovecs with MSG_WAITALL but sent %d\n", expected, done); - exit(1); + fprintf(stderr, "Client %d socket write error: expected to send " + "%d iovecs with MSG_WAITALL but sent %d. Disconnecting client\n", cl->peer_fd, expected, done); + stop_client(cl->peer_fd); + return; } cl->zc_free_list.push_back(NULL); // end marker } diff --git a/src/client/msgr_stop.cpp b/src/client/msgr_stop.cpp index 2cd850e7..aa47d238 100644 --- a/src/client/msgr_stop.cpp +++ b/src/client/msgr_stop.cpp @@ -158,6 +158,13 @@ osd_client_t::~osd_client_t() } // Cancel outbound ops cancel_ops(); + for (osd_op_t *op: zc_free_list) + { + if (op) + { + delete op; + } + } #ifndef __MOCK__ #ifdef WITH_RDMA if (rdma_conn)