This is an automated email from the ASF dual-hosted git repository.

chenBright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 159c8550 Fix RDMA PollCq missing recv CQEs after re-arming the CQs 
(#3425)
159c8550 is described below

commit 159c85505c84d78c030838d402536260805f4a26
Author: Bright Chen <[email protected]>
AuthorDate: Fri Aug 7 17:38:00 2026 +0800

    Fix RDMA PollCq missing recv CQEs after re-arming the CQs (#3425)
    
    PollCq only re-polled send_cq after arming both CQs, so a recv CQE
    arriving in the one-shot notification race window of recv_cq was left
    in the CQ and the RPC timed out. Restart the re-poll from recv_cq so
    that both CQs are covered.
---
 src/brpc/rdma/rdma_endpoint.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/brpc/rdma/rdma_endpoint.cpp b/src/brpc/rdma/rdma_endpoint.cpp
index 6c20ea39..8660d8d9 100644
--- a/src/brpc/rdma/rdma_endpoint.cpp
+++ b/src/brpc/rdma/rdma_endpoint.cpp
@@ -1492,6 +1492,17 @@ void RdmaEndpoint::PollCq(Socket* m) {
                     return;
                 }
                 notified = true;
+                // Both CQs have just been re-armed, thus both of them must be
+                // re-polled. Note that `cq' is `send_cq' here, so we have to
+                // switch back to `recv_cq' explicitly. Otherwise only
+                // `send_cq' would be re-polled, and a recv CQE arriving in
+                // the window between the poll and the notify of `recv_cq'
+                // would be left in the CQ without any following event
+                // (one shot notification is not triggered by the CQE which
+                // is already in the CQ before the arming), which stalls the
+                // connection until the next CQE happens to come.
+                send = false;
+                cq = ep->_resource->recv_cq;
                 continue;
             }
             if (!m->MoreReadEvents(&progress)) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to