From 2b0a802ea1dca1051f7edef8415608b5ee969602 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 23 May 2025 20:54:03 +0300 Subject: [PATCH] Fix iothreads sometimes hanging after adding zerocopy support --- src/client/msgr_receive.cpp | 2 ++ src/client/msgr_send.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/msgr_receive.cpp b/src/client/msgr_receive.cpp index 51b431d9..d994443f 100644 --- a/src/client/msgr_receive.cpp +++ b/src/client/msgr_receive.cpp @@ -35,6 +35,8 @@ void osd_messenger_t::read_requests() ring_data_t data_local; sqe_local.user_data = (uint64_t)&data_local; io_uring_sqe* sqe = (iothread ? &sqe_local : ringloop->get_sqe()); + if (iothread) + data_local = {}; if (!sqe) { cl->read_msg.msg_iovlen = 0; diff --git a/src/client/msgr_send.cpp b/src/client/msgr_send.cpp index c9d0fdec..302160c3 100644 --- a/src/client/msgr_send.cpp +++ b/src/client/msgr_send.cpp @@ -196,10 +196,10 @@ bool osd_messenger_t::try_send(osd_client_t *cl) ring_data_t data_local; sqe_local.user_data = (uint64_t)&data_local; io_uring_sqe* sqe = (iothread ? &sqe_local : ringloop->get_sqe()); + if (iothread) + data_local = {}; if (!sqe) - { return false; - } cl->write_msg.msg_iov = cl->send_list.data(); cl->write_msg.msg_iovlen = cl->send_list.size() < IOV_MAX ? cl->send_list.size() : IOV_MAX; cl->refs++;