Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
159c855
Fix RDMA PollCq missing recv CQEs after re-arming the CQs (#3425)
chenBright Aug 7, 2026
0c8aede
Fix rdma handshake failing the socket instead of falling back to TCP …
chenBright Aug 7, 2026
0ec3a9d
Refactor streaming rpc (#3422)
chenBright Aug 9, 2026
7a3e034
Fix brpc_proto_library failure when brpc is used as an external Bazel…
chenBright Aug 9, 2026
cb84e83
fix rpcz root client span lifetime (#3420) (#3421)
lh2debug-2 Aug 9, 2026
ce0eaec
Merge pull request #3429 from wasphin/feature/protobuf-35
wasphin Aug 9, 2026
febb014
Signal workers for priority tasks (#3423)
chenBright Aug 10, 2026
1175311
test: wait for submitted spans to be collected (#3448)
ZhengweiZhu Aug 15, 2026
58ad904
build: complete UBRING Bazel and CI support (#3445)
ZhengweiZhu Aug 15, 2026
04d0bf0
fix(test): avoid overriding the configured C++ standard (#3446)
zchuango Aug 15, 2026
5a80007
Replace NULL with nullptr in butil/debug (#3438)
chenBright Aug 15, 2026
bd6fa80
Replace NULL with nullptr in butil/details, butil/mac, butil/synchron…
chenBright Aug 15, 2026
950cf26
Refactor NULL with nullptr in butil/files (#3440)
chenBright Aug 15, 2026
a22d305
Refactor NULL with nullptr in butil/memory (#3441)
chenBright Aug 15, 2026
9f9b62f
Refactor NULL with nullptr in butil/strings (#3442)
chenBright Aug 15, 2026
a2a43d9
Refactor NULL with nullptr in butil/threading (#3443)
chenBright Aug 15, 2026
3124cf0
Replace NULL with nullptr in butil/containers (#3437)
chenBright Aug 15, 2026
24146ca
cap simple string length in RedisReply::ConsumePartialIOBuf (#3404)
ubeddulla Aug 15, 2026
e0abb10
Progressive timeout dev (#3409)
zchuango Aug 15, 2026
437a7b7
Limit mcpack2pb array item count to the actual payload size (#3451)
wwbmmm Aug 15, 2026
ca370c2
Fix RTMP abort message deleting the chunk stream being parsed (#3452)
wwbmmm Aug 15, 2026
552bfd6
Fix SOFA PBRPC parser not limiting metadata size (#3449)
wwbmmm Aug 15, 2026
48db968
Refactor NULL with nullptr in butil (#3444)
chenBright Aug 16, 2026
9aa41f7
Support flow-controlled gRPC client requests (#3430)
wasphin Aug 16, 2026
137c1ca
Revert "Progressive timeout dev (#3409)" (#3453)
wwbmmm Aug 16, 2026
7f64663
Fix WeightedRandomizedLoadBalancer skipping the last server (#3426)
Nas01010101 Aug 16, 2026
96ce9f1
Fix bug when parsing zero-length string field in mcpack2pb (#3450)
wwbmmm Aug 16, 2026
7f8120a
Refactor NULL with nullptr in brpc/details (#3457)
chenBright Aug 18, 2026
f0f72fd
Refactor NULL with nullptr in json2pb (#3455)
chenBright Aug 18, 2026
3188cb5
Refactor NULL with nullptr in brpc/builtin (#3456)
chenBright Aug 18, 2026
64120a3
Refactor NULL with nullptr in brpc/ubshm (#3460)
chenBright Aug 18, 2026
11f8192
Refactor NULL with nullptr in brpc/rdma (#3459)
chenBright Aug 18, 2026
3366074
Refactor NULL with nullptr in brpc/policy (#3458)
chenBright Aug 18, 2026
5205a9e
Add URMA transport support
zchuango Aug 5, 2026
5d7edc4
fix: address review comments on naming, IOBuf sizing and UMDK pinning
cw20050111-prog Aug 12, 2026
617e6d6
docs(urma): add Bazel build section and document its limitations
cw20050111-prog Aug 14, 2026
52abfc0
fix(bazel): add missing package marker for umdk third-party build file
cw20050111-prog Aug 14, 2026
6d70397
fix(bazel): strip upstream src/urma/BUILD.bazel so umdk headers glob …
cw20050111-prog Aug 14, 2026
917c11d
fix(urma): require explicit opt-in for the URMA link-time mock
cw20050111-prog Aug 17, 2026
e32985a
Link liburma for all examples
cw20050111-prog Aug 18, 2026
947df20
Drop duplicate liburma lookup in urma_performance
cw20050111-prog Aug 18, 2026
069df85
Add comment about linking liburma in BrpcExample.cmake
cw20050111-prog Aug 18, 2026
eda12bc
Revert liburma linking for diagnosis
cw20050111-prog Aug 18, 2026
fb3b3c9
Check for URMA library and update build configuration
cw20050111-prog Aug 18, 2026
3e36620
Add URMA library search to CMake configuration
cw20050111-prog Aug 18, 2026
78f8b08
Update CMake to link with URMA library conditionally
cw20050111-prog Aug 18, 2026
cbbf495
Remove URMA library check from CMakeLists.txt
cw20050111-prog Aug 18, 2026
7949cea
Refactor URMA library linking logic in CMake
cw20050111-prog Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
./example/build_with_bazel
./example/build_with_bazel_module
./example/build_with_old_bazel

# `registry/` is brpc's self-maintained Bzlmod registry. Its overlay
# BUILD.bazel files reference sources from the libunwind tarball that is
Expand Down
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ build:macos-asan --copt -D_FORTIFY_SOURCE=0
build:macos-asan --dynamic_mode=off

test:asan --test_env=ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=1

build:ubring --define BRPC_WITH_UBRING=true
67 changes: 55 additions & 12 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
run: |
export CC=gcc && export CXX=g++
mkdir gcc_build_all && cd gcc_build_all
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON \
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON -DWITH_UBRING=ON \
-DWITH_DEBUG_BTHREAD_SCHE_SAFETY=ON -DWITH_DEBUG_LOCK=ON -DWITH_BTHREAD_TRACER=ON \
-DWITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
make -j ${{env.proc_num}} && make clean
Expand Down Expand Up @@ -123,24 +123,44 @@ jobs:
# real server (e.g. brpc_redis_unittest) actually run under bazel instead
# of skipping. Same shared action the make-based unittest jobs use.
- uses: ./.github/actions/install-essential-dependencies
- run: bazel test //test/...
- run: bazel test --config=rdma --config=ubring //test/...

gcc-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: |
- run: sudo apt-get update && sudo apt-get install -y libibverbs-dev
- name: root
run: |
bazel build --define with_mesalink=false \
--define with_glog=true \
--define with_thrift=true \
--define BRPC_WITH_RDMA=true \
--define BRPC_WITH_UBRING=true \
--define BRPC_WITH_BORINGSSL=true \
--define with_debug_bthread_sche_safety=true \
--define with_debug_lock=true \
--define with_asan=true \
--define with_bthread_tracer=true \
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
--define with_babylon_counter=true \
-- //:brpc //example/...
- name: external
run: |
cd example/build_with_bazel_module
bazel build --define with_mesalink=false \
--define with_glog=true \
--define with_thrift=true \
--define BRPC_WITH_RDMA=true \
--define BRPC_WITH_UBRING=true \
--define BRPC_WITH_BORINGSSL=true \
--define with_debug_bthread_sche_safety=true \
--define with_debug_lock=true \
--define with_asan=true \
--define with_bthread_tracer=true \
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
--define with_babylon_counter=true \
-- //:brpc
-- //...

clang-compile-with-make-protobuf:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -182,25 +202,48 @@ jobs:
- run: |
bazel test --test_output=streamed \
--action_env=CC=clang \
--config=rdma \
--config=ubring \
//test/...

clang-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: |
- run: sudo apt-get update && sudo apt-get install -y libibverbs-dev
- name: root
run: |
bazel build --action_env=CC=clang \
--define with_mesalink=false \
--define with_glog=true \
--define with_thrift=true \
--define BRPC_WITH_RDMA=true \
--define BRPC_WITH_UBRING=true \
--define BRPC_WITH_BORINGSSL=true \
--define with_debug_bthread_sche_safety=true \
--define with_debug_lock=true \
--define with_asan=true \
--define with_bthread_tracer=true \
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
--define with_babylon_counter=true \
-- //:brpc //example/...
- name: external
run: |
cd example/build_with_bazel_module
bazel build --action_env=CC=clang \
--define with_mesalink=false \
--define with_glog=true \
--define with_thrift=true \
--define BRPC_WITH_RDMA=true \
--define BRPC_WITH_UBRING=true \
--define BRPC_WITH_BORINGSSL=true \
--define with_debug_bthread_sche_safety=true \
--define with_debug_lock=true \
--define with_asan=true \
--define with_bthread_tracer=true \
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
--define with_babylon_counter=true \
-- //:brpc
-- //...

clang-unittest:
runs-on: ubuntu-22.04
Expand All @@ -209,7 +252,7 @@ jobs:
- uses: ./.github/actions/install-essential-dependencies
- uses: ./.github/actions/init-ut-make-config
with:
options: --with-bthread-tracer
options: --with-bthread-tracer --with-rdma
- name: compile tests
run: |
cat config.mk
Expand Down Expand Up @@ -245,10 +288,10 @@ jobs:
clang-unittest-bazel-with-babylon-and-new-pb:
runs-on: ubuntu-22.04
env:
TEST_PROTOBUF_VERSION: "34.1"
# protobuf >= 34.x uses new ProtoInfo fields (option_deps,
# extension_declarations) introduced in Bazel 8.x. The repo's
# .bazelversion (7.2.1) is too old. bazelisk honors USE_BAZEL_VERSION.
TEST_PROTOBUF_VERSION: "35.1"
# protobuf >= 34.x uses new ProtoInfo fields (option_deps, extension_declarations)
# introduced in Bazel 8.x. The repo's .bazelversion (7.2.1) is too old. bazelisk
# honors USE_BAZEL_VERSION.
USE_BAZEL_VERSION: "8.3.1"
steps:
- uses: actions/checkout@v2
Expand All @@ -263,7 +306,7 @@ jobs:
grep -qE "bazel_dep\(name = ['\"]protobuf['\"], version = ['\"]${TEST_PROTOBUF_VERSION}['\"]" MODULE.bazel \
|| { echo "ERROR: failed to override protobuf version in MODULE.bazel to ${TEST_PROTOBUF_VERSION}"; exit 1; }
- run: |
bazel test --action_env=CC=clang --config=rdma \
bazel test --action_env=CC=clang --config=rdma --config=ubring \
--define with_bthread_tracer=true \
--define with_babylon_counter=true \
//test/...
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ CTestTestfile.cmake
/test/out.txt
/test/recordio_ref.io

# Local design notes and Graphify artifacts.
docs/cn/urma_proposal.md
graphify-out/

# Ignore protoc-gen-mcpack files
/protoc-gen-mcpack*/

Expand Down
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ header:
- 'example/*/*.json'
- 'example/*/*.pem'
- 'example/*/*.port'
- 'example/build_with_bazel_module/.bazelversion'
- 'src/bthread/offset_inl.list'
- 'test/*.crt'
- 'test/*.key'
Expand Down
16 changes: 13 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ DEFINES = [
}) + select({
"//bazel/config:brpc_with_rdma": ["BRPC_WITH_RDMA=1"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_ubring": ["BRPC_WITH_UBRING=1"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_urma": ["BRPC_WITH_URMA=1"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_debug_bthread_sche_safety": ["BRPC_DEBUG_BTHREAD_SCHE_SAFETY=1"],
"//conditions:default": ["BRPC_DEBUG_BTHREAD_SCHE_SAFETY=0"],
Expand Down Expand Up @@ -520,6 +526,7 @@ filegroup(
"src/brpc/*.proto",
"src/brpc/policy/*.proto",
"src/brpc/rdma/*.proto",
"src/brpc/urma/*.proto",
]),
visibility = ["//visibility:public"],
)
Expand Down Expand Up @@ -558,9 +565,7 @@ cc_library(
"src/brpc/event_dispatcher_kqueue.cpp",
]),
copts = COPTS,
includes = [
"src/",
],
includes = ["src/"],
linkopts = LINKOPTS,
visibility = ["//visibility:public"],
deps = [
Expand All @@ -572,6 +577,11 @@ cc_library(
":mcpack2pb",
"@com_github_google_leveldb//:leveldb",
] + select({
"//bazel/config:brpc_with_urma": [
"@umdk//:urma_headers",
],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_thrift": [
"@org_apache_thrift//:thrift",
],
Expand Down
94 changes: 93 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ option(WITH_THRIFT "With thrift framed protocol supported" OFF)
option(WITH_BTHREAD_TRACER "With bthread tracer supported" OFF)
option(WITH_SNAPPY "With snappy" OFF)
option(WITH_RDMA "With RDMA" OFF)
option(WITH_URMA "With URMA (openEuler Unified Remote Memory Access)" OFF)
option(DOWNLOAD_URMA_HEADERS
"Download UMDK headers when WITH_URMA is enabled and headers are absent"
ON)
option(WITH_URMA_MOCK
"Explicitly allow linking brpc's URMA link-time mock when liburma is not found (WITH_URMA only). The mock cannot talk to real URMA hardware, so this must be opted into rather than silently substituted."
OFF)
option(WITH_UBRING "With UB" OFF)
option(WITH_DEBUG_BTHREAD_SCHE_SAFETY "With debugging bthread sche safety" OFF)
option(WITH_DEBUG_LOCK "With debugging lock" OFF)
Expand Down Expand Up @@ -121,6 +128,11 @@ if(WITH_RDMA)
set(WITH_RDMA_VAL "1")
endif()

set(WITH_URMA_VAL "0")
if(WITH_URMA)
set(WITH_URMA_VAL "1")
endif()

set(WITH_UBRING_VAL "0")
if(WITH_UBRING)
set(WITH_UBRING_VAL "1")
Expand Down Expand Up @@ -160,6 +172,7 @@ endif()
list(APPEND BRPC_COMMON_DEFINITIONS
BRPC_WITH_GLOG=${WITH_GLOG_VAL}
BRPC_WITH_RDMA=${WITH_RDMA_VAL}
BRPC_WITH_URMA=${WITH_URMA_VAL}
BRPC_WITH_UBRING=${WITH_UBRING_VAL}
BRPC_DEBUG_BTHREAD_SCHE_SAFETY=${WITH_DEBUG_BTHREAD_SCHE_SAFETY_VAL}
BRPC_DEBUG_LOCK=${WITH_DEBUG_LOCK_VAL}
Expand Down Expand Up @@ -318,6 +331,63 @@ if(WITH_RDMA)
list(APPEND BRPC_COMMON_INCLUDE_DIRS ${RDMA_INCLUDE_PATH})
endif()

if(WITH_URMA)
# UrmaTransport and its link-time mock both compile against the upstream
# UMDK API. Prefer installed headers; otherwise fetch a pinned upstream
# release, following Mooncake's URMA mock setup.
find_path(URMA_INCLUDE_PATH NAMES urma_api.h
HINTS ENV URMA_ROOT
PATHS /usr/include /usr/local/include
PATH_SUFFIXES ub/umdk/urma umdk/urma urma
src/urma/lib/urma/core/include)
find_path(URMA_BOND_INCLUDE_PATH NAMES urma_ubagg.h
HINTS ENV URMA_ROOT
PATHS /usr/include /usr/local/include
PATH_SUFFIXES ub/umdk/urma umdk/urma urma
src/urma/lib/urma/bond/include)
if(NOT URMA_INCLUDE_PATH AND DOWNLOAD_URMA_HEADERS)
include(FetchContent)
FetchContent_Declare(
urma_headers
GIT_REPOSITORY https://atomgit.com/openeuler/umdk.git
GIT_TAG v26.06.0_CAM
GIT_SHALLOW TRUE)
FetchContent_GetProperties(urma_headers)
if(NOT urma_headers_POPULATED)
FetchContent_Populate(urma_headers)
endif()
set(URMA_INCLUDE_PATH
"${urma_headers_SOURCE_DIR}/src/urma/lib/urma/core/include")
set(URMA_BOND_INCLUDE_PATH
"${urma_headers_SOURCE_DIR}/src/urma/lib/urma/bond/include")
message(STATUS "Using downloaded UMDK headers: ${URMA_INCLUDE_PATH}")
endif()
if(NOT URMA_INCLUDE_PATH)
message(FATAL_ERROR
"Fail to find urma_api.h. Install UMDK headers, set URMA_ROOT, "
"or enable DOWNLOAD_URMA_HEADERS.")
endif()

find_library(URMA_LIB NAMES urma
HINTS ENV URMA_ROOT
PATH_SUFFIXES lib lib64)
if(URMA_LIB)
message(STATUS "Found URMA library: ${URMA_LIB}")
set(URMA_USE_MOCK 0)
elseif(WITH_URMA_MOCK)
message(STATUS
"liburma not found; WITH_URMA_MOCK=ON, building with the URMA "
"link-time mock")
set(URMA_USE_MOCK 1)
else()
message(FATAL_ERROR
"Fail to find liburma. Install liburma, set URMA_ROOT, or "
"explicitly opt into brpc's link-time mock with "
"-DWITH_URMA_MOCK=ON (the mock cannot talk to real URMA "
"hardware; only enable it for CI/tests without URMA hardware).")
endif()
endif()

find_library(PROTOC_LIB NAMES protoc)
if(NOT PROTOC_LIB)
message(FATAL_ERROR "Fail to find protoc lib")
Expand All @@ -342,6 +412,12 @@ list(APPEND BRPC_COMMON_INCLUDE_DIRS
${PROTOBUF_INCLUDE_DIRS}
${LEVELDB_INCLUDE_PATH}
)
if(WITH_URMA)
list(APPEND BRPC_COMMON_INCLUDE_DIRS ${URMA_INCLUDE_PATH})
if(URMA_BOND_INCLUDE_PATH)
list(APPEND BRPC_COMMON_INCLUDE_DIRS ${URMA_BOND_INCLUDE_PATH})
endif()
endif()

set(DYNAMIC_LIB
${GFLAGS_LIBRARY}
Expand Down Expand Up @@ -370,6 +446,13 @@ if(WITH_RDMA)
list(APPEND DYNAMIC_LIB ${RDMA_LIB})
endif()

if(WITH_URMA)
message(STATUS "brpc compile with URMA (mock=${URMA_USE_MOCK})")
if(NOT URMA_USE_MOCK)
list(APPEND DYNAMIC_LIB ${URMA_LIB})
endif()
endif()

if(WITH_UBRING)
message(STATUS "brpc compile with ubring")
list(APPEND DYNAMIC_LIB ${UB_LIB})
Expand Down Expand Up @@ -575,6 +658,14 @@ file(GLOB_RECURSE BRPC_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/brpc
file(GLOB_RECURSE THRIFT_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/brpc/thrift*.cpp")
file(GLOB_RECURSE EXCLUDE_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/brpc/event_dispatcher_*.cpp")

# When building with the real liburma, exclude the link-time mock so its urma_*
# symbols do not clash with the library. When liburma is absent, keep it so CI
# can build and test UrmaTransport without URMA hardware.
if(WITH_URMA AND NOT URMA_USE_MOCK)
list(REMOVE_ITEM BRPC_SOURCES
"${PROJECT_SOURCE_DIR}/src/brpc/urma/mock_urma.cpp")
endif()

if(WITH_THRIFT)
message("brpc compile with thrift protocol")
else()
Expand Down Expand Up @@ -615,7 +706,8 @@ set(PROTO_FILES idl_options.proto
brpc/trackme.proto
brpc/streaming_rpc_meta.proto
brpc/proto_base.proto
brpc/rdma/rdma_handshake.proto)
brpc/rdma/rdma_handshake.proto
brpc/urma/urma_handshake.proto)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/output/include/brpc)
set(PROTOC_FLAGS ${PROTOC_FLAGS} -I${PROTOBUF_INCLUDE_DIR})
compile_proto(PROTO_HDRS PROTO_SRCS ${PROJECT_BINARY_DIR}
Expand Down
Loading