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)