Repository navigation
Conversation
…lity Resolve UBSHM handshake conflicts using the tested rebased tree. Retain backend-specific format negotiation, remote shared-memory lengths, and upstream IPC V2 tests.
Resolve current master conflicts and preserve UBSHM IPC V2 negotiation
Resolve master conflict and preserve shared memory name safety
…refresh Resolve modular CMake conflict and preserve handshake protobuf generation
* Unify transport handshakes on current upstream master * Fix certificate name extraction with const OpenSSL accessors * Integrate URMA with the common transport handshake Port URMA v2 and v3 negotiation into AdapterTransport while preserving the existing RDMA and UBSHM implementations and regression tests. Include standalone bonding import, ordered SEND work requests, the 4096-byte CTP payload limit, bounded diagnostics, mock regression coverage and concise documentation. * Run Linux CI for transport handshake pull requests * Fix URMA handshake fallback compatibility * Use nullptr and refresh URMA handshake factory tests * Test legacy URMA interoperability and final ACK handoff * Fix URMA CQ callback lifetime during teardown Pin the main Socket through a carrier-owned context before endpoint access. Serialize CQ dispatch with teardown and reject callbacks from an earlier reset generation. Add barrier-controlled event/polling and copy/zero-copy regressions for concurrent close, last-reference recycling, and stale callbacks after reset. Keep this lifecycle fix separate from handshake wire compatibility. * Simplify URMA documentation * Restore upstream CI and URMA documentation * Clarify URMA handshake comments and align local style --------- Co-authored-by: Chuang Zhang <zchuang185@gmail.com>
Preserve the common handshake source directory together with the upstream FlatBuffers conditional sources in Makefile. Keep upstream workflows and existing URMA documentation unchanged.
|
Could you give some advice? @chenBright @wwbmmm |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved handshake initialization, failure handling, and fallback resource cleanup issues can cause undefined behavior or retain connection resources.
3 open issues
What changed in this PR
This PR extends the common transport handshake framework from #3535 to URMA, centralizing connection setup and TCP fallback while keeping transport-specific resources and data transfer in their endpoints.
Changes:
- Integrates URMA v2/v3 negotiation and legacy fallback behavior with the common handshake.
- Updates transport activation, receive-event handoff, URMA ordering, and completion lifetime management.
- Adds fallback tests, stream tracing, documentation, and build integration.
| File | Description |
|---|---|
| test/CMakeLists.txt | Orders test protobuf compilation after core generation. |
| test/brpc_urma_fallback_unittest.cpp | Tests URMA framing and TCP fallback without hardware. |
| src/brpc/urma/urma_stream_trace.h | Adds bounded stream diagnostics. |
| src/brpc/urma/urma_helper.h | Declares bonding import-layout selection. |
| src/brpc/urma/urma_helper.cpp | Handles standalone bonding import layout. |
| src/brpc/urma/urma_endpoint.h | Adds deferred completion callbacks and lifetime tracking. |
| src/brpc/urma/mock_urma.cpp | Checks SEND contracts and delays completion until copying finishes. |
| src/brpc/urma_transport.h | Exposes URMA upgrade resource operations. |
| src/brpc/urma_transport.cpp | Separates URMA data transfer from handshake and fallback orchestration. |
| src/brpc/ubshm/ub_endpoint.h | Removes handshake state and defers receive startup. |
| src/brpc/ubshm_transport.h | Exposes common-handshake resource operations. |
| src/brpc/ubshm_transport.cpp | Delegates connection orchestration to AdapterTransport. |
| src/brpc/transport_handshake.h | Defines shared handshake contracts and session state. |
| src/brpc/transport_handshake.cpp | Implements negotiation, activation, and fallback sequencing. |
| src/brpc/transport_factory.h | Updates the factory description comment. |
| src/brpc/transport_factory.cpp | Creates AdapterTransport for supported socket modes. |
| src/brpc/socket.h | Grants common handshake components socket access. |
| src/brpc/rdma/rdma_handshake.h | Removes legacy RDMA handshake interfaces. |
| src/brpc/rdma/rdma_handshake.cpp | Removes the legacy RDMA handshake implementation. |
| src/brpc/rdma/rdma_handshake_server.h | Removes the old server handshake interface. |
| src/brpc/rdma/rdma_handshake_server.cpp | Removes the old server fallback implementation. |
| src/brpc/rdma/rdma_endpoint.h | Keeps resource operations separate from handshake orchestration. |
| src/brpc/rdma_transport.h | Exposes RDMA upgrade operations and adapter factories. |
| src/brpc/rdma_transport.cpp | Integrates RDMA resources with common orchestration. |
| src/brpc/rdma_handshake.proto | Provides the relocated RDMA v3 schema. |
| src/brpc/policy/transport_handshake_protocol.h | Declares the shared handshake parser. |
| src/brpc/policy/transport_handshake_protocol.cpp | Routes parsing through AdapterTransport. |
| src/brpc/policy/rdma_handshake_protocol.h | Retains the legacy parser compatibility interface. |
| src/brpc/policy/rdma_handshake_protocol.cpp | Forwards legacy entry points to the shared parser. |
| src/brpc/input_messenger.h | Declares transport-aware TCP read stopping. |
| src/brpc/input_messenger.cpp | Stops TCP draining when the transport changes. |
| src/brpc/handshake/urma_handshake.h | Declares common URMA adapters and legacy helpers. |
| src/brpc/handshake/urma_handshake.cpp | Implements URMA v2/v3 codecs and server integration. |
| src/brpc/handshake/urma_fallback_handshake.cpp | Supports URMA rejection in TCP-only builds. |
| src/brpc/handshake/ubshm_handshake.h | Defines UBSHM handshake fields and adapter interfaces. |
| src/brpc/handshake/ubshm_handshake.cpp | Implements UBSHM negotiation and server fallback. |
| src/brpc/handshake/rdma_handshake.h | Defines common RDMA protocol adapters. |
| src/brpc/handshake/rdma_handshake.cpp | Implements RDMA codecs and server integration. |
| src/brpc/handshake/rdma_handshake_constants.h | Defines shared RDMA frame specifications. |
| src/brpc/handshake/handshake_io.h | Defines blocking and buffered handshake I/O. |
| src/brpc/handshake/handshake_io.cpp | Implements socket-backed handshake reads and writes. |
| src/brpc/handshake/handshake_frame.h | Defines frame specifications and codec operations. |
| src/brpc/handshake/handshake_frame.cpp | Implements framing and length validation. |
| src/brpc/handshake/handshake_adapter.h | Defines the server parser adapter interface. |
| src/brpc/handshake/handshake_adapter.cpp | Preserves parser context across handshake steps. |
| src/brpc/global.cpp | Registers the shared parser under the existing protocol identifier. |
| src/brpc/CMakeLists.txt | Updates the RDMA protobuf path. |
| src/brpc/adapter_transport.h | Defines top-level transport selection and orchestration. |
| Makefile | Includes handshake sources and fallback protobuf dependencies. |
| docs/cn/handshake_common_design.md | Documents architecture, fallback, and data-path handoff. |
| BUILD.bazel | Updates protobuf discovery and URMA source selection. |
Review effort: Balanced
| SocketHandshakeIO::SocketHandshakeIO(Socket* socket) | ||
| : _socket(socket) | ||
| , _read_butex(bthread::butex_create_checked<butil::atomic<int> >()) { | ||
| } |
| [this](const timespec* duetime) { | ||
| return _socket->WaitEpollOut( | ||
| _socket->fd(), true, duetime); | ||
| }); |
#3645 builds on #3535, so I’ll focus on resolving the remaining review comments in #3535 first. Once it is merged, I’ll rebase #3645 onto master so that it contains only the URMA-specific changes. I’ll hold off on requesting further review here until then. |
There was a problem hiding this comment.
🔵 Needs a closer look
The handshake counter initialization defect remains unresolved, and the cross-transport state-machine and concurrent completion-lifecycle changes warrant final human review.
3 open issues
1 resolved since last review
Review effort: Balanced
| SocketHandshakeIO::SocketHandshakeIO(Socket* socket) | ||
| : _socket(socket) | ||
| , _read_butex(bthread::butex_create_checked<butil::atomic<int> >()) { | ||
| } |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
Review effort: Lite
| int SocketHandshakeIO::PushBack(const void* data, size_t len) { | ||
| CHECK(_socket != nullptr); | ||
| if (len != 0) { | ||
| return _socket->fd_input_processor().read_buf().append(data, len) == 0 ? 0 : -1; |

What problem does this PR solve?
Issue Number: N/A
Related Discussion: #3432
Related PR: #3535
Problem Summary:
PR #3535 introduces the common transport-level handshake framework and migrates RDMA and UBSHM to it. This PR extends the same framework to URMA.
URMA previously managed TCP handshake I/O, framing, negotiation, state transitions and fallback inside its endpoint. Moving this orchestration into AdapterTransport gives the high-speed transports a consistent connection setup flow, while URMA retains ownership of its resources and data-plane operations.
What is changed and the side effects?
Changed:
Handshake integration:
URMA) and protobuf v3 (URM3) wire formats.URMA data-plane updates:
Side effects:
Validation
Automated tests:
Hardware tests:
Development PR CI: all 24 checks passed at 91bf2d1.
Check List