Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5934fc0
Reject empty MySQL response packets (#3536)
wasphin Sep 12, 2026
25dc213
Add release skill (#3537)
chenBright Sep 13, 2026
1b6d435
Fix bthread_join memory visibility with paired release/acquire on ver…
chenBright Sep 13, 2026
2a75bbc
Ignore canceled requests in the circuit breaker (#3532)
wushinanqiyi Sep 13, 2026
5cc723f
feat: limit server connections per public listener (#3498)
thweetkomputer Sep 14, 2026
e69943b
Stabilize timer and socket unit tests (#3540)
wasphin Sep 14, 2026
bb0861e
Escape HTML output in builtin /flags service (#3529)
wwbmmm Sep 14, 2026
023dc4f
Bound the number of http headers and query parameters per message (#3…
chenBright Sep 15, 2026
09f36c5
Fix lost wakeup in ParkingLot waiter check (#3539)
chenBright Sep 15, 2026
8b2410d
Fix client source IP binding loss after socket revival (#3544)
chenBright Sep 15, 2026
8102b17
Support seqlock and use it for TaskGroup CPU time stat (#3541)
chenBright Sep 16, 2026
e97cff7
Make Prometheus latency output consistent between LatencyRecorder and…
chenBright Sep 17, 2026
8f7c18c
Release Apache bRPC 1.18.0 (#3550)
chenBright Sep 17, 2026
2ebae47
Document Debug CMake build on Apple Silicon (#3548)
hesphoros Sep 18, 2026
abc5595
fix: preserve XMM6-XMM15 in x86_64 bthread context switch (#3495)
zchuango Sep 18, 2026
64480c7
feat: add URMA transport support (#3428)
zchuango Sep 18, 2026
46c2180
Fix ineffective enable_if constraints in bvar and butil (#3547)
chenBright Sep 18, 2026
0b990a0
Reuse standard CMake build directory in docs (#3552)
hesphoros Sep 19, 2026
b9cacba
Let CMake manage NDEBUG by build configuration (#3553)
hesphoros Sep 19, 2026
2ce519a
Update new commiter doc (#3555)
wwbmmm Sep 19, 2026
ea127c7
Stabilize butex join test (#3554)
wasphin Sep 21, 2026
754eeb9
Stabilize butex stop-before-running test (#3556)
wasphin Sep 21, 2026
ab532da
Add UBRing data format negotiation (#3507)
zchuango Sep 21, 2026
c79b3ff
Fix two races between butex_wait() and TaskGroup::interrupt() (#3551)
chenBright Sep 22, 2026
5866e11
Fix use-after-free in RTMP test sender lifetime management (#3543)
chenBright Sep 22, 2026
d02ed85
Merge remote-tracking branch 'upstream/master' into review/pr3535-res…
Spicy-cream Sep 22, 2026
9e2577a
refactor: introduce transport handshake participants
Spicy-cream Sep 23, 2026
b93a6ab
docs: align handshake design with participant interfaces
Spicy-cream Sep 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
51 changes: 42 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ DEFINES = [
"//bazel/config:brpc_with_rdma": ["BRPC_WITH_RDMA=1"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_ubring": ["BRPC_WITH_UBRING=1"],
"//bazel/config:brpc_with_urma": ["BRPC_WITH_URMA=1"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_ubring": ["BRPC_WITH_UBRING=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"],
}) + select({
Expand Down Expand Up @@ -522,6 +525,7 @@ filegroup(
srcs = glob([
"src/brpc/*.proto",
"src/brpc/policy/*.proto",
"src/brpc/urma/*.proto",
]),
visibility = ["//visibility:public"],
)
Expand All @@ -534,9 +538,20 @@ brpc_proto_library(
visibility = ["//visibility:public"],
)

cc_library(
name = "brpc",
srcs = glob([
URMA_SRC_PATTERNS = [
"src/brpc/urma/*.cpp",
"src/brpc/urma/**/*.cpp",
]

# Keep URMA implementation sources out of BRPC_BASE_SRCS. They are added only
# by the select() below so the mock can never leak into a real-liburma link.
URMA_SRCS = glob(
URMA_SRC_PATTERNS,
exclude = ["src/brpc/urma/mock_urma.cpp"],
)

BRPC_BASE_SRCS = glob(
[
"src/brpc/*.cpp",
"src/brpc/**/*.cpp",
],
Expand All @@ -546,12 +561,23 @@ cc_library(
"src/brpc/policy/thrift_protocol.cpp",
"src/brpc/event_dispatcher_epoll.cpp",
"src/brpc/event_dispatcher_kqueue.cpp",
]) + select({
] + URMA_SRC_PATTERNS,
)

cc_library(
name = "brpc",
srcs = BRPC_BASE_SRCS + select({
"//bazel/config:brpc_with_thrift": glob([
"src/brpc/thrift*.cpp",
"src/brpc/**/thrift*.cpp",
]),
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_urma_use_real": URMA_SRCS,
"//bazel/config:brpc_with_urma": URMA_SRCS + [
"src/brpc/urma/mock_urma.cpp",
],
"//conditions:default": [],
}),
hdrs = glob([
"src/brpc/*.h",
Expand All @@ -560,10 +586,11 @@ cc_library(
"src/brpc/event_dispatcher_kqueue.cpp",
]),
copts = COPTS,
includes = [
"src/",
],
linkopts = LINKOPTS,
includes = ["src/"],
linkopts = LINKOPTS + select({
"//bazel/config:brpc_with_urma_use_real": ["-lurma"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
deps = [
":brpc_internal_cc_proto",
Expand All @@ -574,6 +601,12 @@ cc_library(
":mcpack2pb",
"@com_github_google_leveldb//:leveldb",
] + select({
"//bazel/config:brpc_with_urma_download_headers_disabled": [],
"//bazel/config:brpc_with_urma": [
"@umdk//:urma_headers",
],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_thrift": [
"@org_apache_thrift//:thrift",
],
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

Apache bRPC is an industrial-grade C++ RPC framework supporting multiple protocols (baidu_std, HTTP/H2, gRPC, thrift, redis, memcached, RTMP, RDMA) on the same port. Used in high-performance systems: search, storage, ML, ads, recommendations. Current version: 1.17.0.
Apache bRPC is an industrial-grade C++ RPC framework supporting multiple protocols (baidu_std, HTTP/H2, gRPC, thrift, redis, memcached, RTMP, RDMA) on the same port. Used in high-performance systems: search, storage, ML, ads, recommendations. Current version: 1.18.0.

## Build Commands

Expand Down
114 changes: 108 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ project(brpc C CXX)
option(WITH_GLOG "With glog" OFF)
option(WITH_MESALINK "With MesaLink" OFF)
option(WITH_BORINGSSL "With BoringSSL" OFF)
option(DEBUG "Print debug logs" OFF)
option(WITH_DEBUG_SYMBOLS "With debug symbols" ON)
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)
set(URMA_USE_MOCK "AUTO" CACHE STRING
"URMA mock mode: AUTO, ON, or OFF (OFF requires liburma)")
set_property(CACHE URMA_USE_MOCK PROPERTY STRINGS AUTO ON OFF)
option(DOWNLOAD_URMA_HEADERS
"Download UMDK headers when WITH_URMA is enabled and headers are absent"
ON)
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 All @@ -42,7 +48,7 @@ if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()

set(BRPC_VERSION 1.17.0)
set(BRPC_VERSION 1.18.0)

SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "brpc authors")
Expand Down Expand Up @@ -120,6 +126,19 @@ if(WITH_RDMA)
set(WITH_RDMA_VAL "1")
endif()

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

string(TOUPPER "${URMA_USE_MOCK}" URMA_USE_MOCK_MODE)
if(NOT URMA_USE_MOCK_MODE STREQUAL "AUTO" AND
NOT URMA_USE_MOCK_MODE STREQUAL "ON" AND
NOT URMA_USE_MOCK_MODE STREQUAL "OFF")
message(FATAL_ERROR
"URMA_USE_MOCK must be AUTO, ON, or OFF, got: ${URMA_USE_MOCK}")
endif()

set(WITH_UBRING_VAL "0")
if(WITH_UBRING)
set(WITH_UBRING_VAL "1")
Expand Down Expand Up @@ -159,6 +178,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 All @@ -174,9 +194,6 @@ list(APPEND BRPC_COMMON_DEFINITIONS
__STRICT_ANSI__
)

if(NOT DEBUG)
list(APPEND BRPC_COMMON_DEFINITIONS NDEBUG)
endif()
if(WITH_ASAN)
list(APPEND BRPC_COMMON_COMPILE_OPTIONS -fsanitize=address)
list(APPEND BRPC_COMMON_LINK_OPTIONS -fsanitize=address)
Expand Down Expand Up @@ -318,6 +335,69 @@ 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
# commit, 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 564ee727a55523d4351a8fb3c94292b388ebb924
# brpc only consumes UMDK headers; avoid cloning unrelated UMDK
# submodules such as CAM dependencies during configuration.
GIT_SUBMODULES ""
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_USE_MOCK_MODE STREQUAL "ON")
message(STATUS "URMA_USE_MOCK=ON; forcing the link-time URMA mock")
set(URMA_USE_MOCK_ENABLED 1)
elseif(URMA_USE_MOCK_MODE STREQUAL "OFF")
if(NOT URMA_LIB)
message(FATAL_ERROR
"URMA_USE_MOCK=OFF requires liburma; install it or use AUTO/ON.")
endif()
message(STATUS "URMA_USE_MOCK=OFF; using liburma")
set(URMA_USE_MOCK_ENABLED 0)
elseif(URMA_LIB)
message(STATUS "Found URMA library: ${URMA_LIB}")
set(URMA_USE_MOCK_ENABLED 0)
else()
message(STATUS
"liburma not found; building with the URMA link-time mock")
set(URMA_USE_MOCK_ENABLED 1)
endif()
endif()

find_library(PROTOC_LIB NAMES protoc)
if(NOT PROTOC_LIB)
message(FATAL_ERROR "Fail to find protoc lib")
Expand All @@ -342,6 +422,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 +456,13 @@ if(WITH_RDMA)
list(APPEND DYNAMIC_LIB ${RDMA_LIB})
endif()

if(WITH_URMA)
message(STATUS "brpc compile with URMA (mock=${URMA_USE_MOCK_ENABLED})")
if(NOT URMA_USE_MOCK_ENABLED)
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 @@ -579,6 +672,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_ENABLED)
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 @@ -619,7 +720,8 @@ set(PROTO_FILES idl_options.proto
brpc/trackme.proto
brpc/streaming_rpc_meta.proto
brpc/proto_base.proto
brpc/rdma_handshake.proto)
brpc/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
13 changes: 12 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

module(
name = 'brpc',
version = '1.17.0',
version = '1.18.0',
compatibility_level = 1,
)

Expand Down Expand Up @@ -68,3 +68,14 @@ git_override(
remote = 'https://github.com/hedronvision/bazel-compile-commands-extractor.git',
commit = '1e08f8e0507b6b6b1f4416a9a22cf5c28beaba93', # Jun 28, 2024
)

git_repository = use_repo_rule(
'@bazel_tools//tools/build_defs/repo:git.bzl',
'git_repository',
)
git_repository(
name = 'umdk',
build_file = '//bazel/third_party/umdk:umdk.BUILD',
remote = 'https://atomgit.com/openeuler/umdk.git',
commit = '564ee727a55523d4351a8fb3c94292b388ebb924', # v26.06.0_CAM
)
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,15 @@ JSON2PB_SOURCES = $(foreach d,$(JSON2PB_DIRS),$(wildcard $(addprefix $(d)/*,$(SR
JSON2PB_OBJS = $(addsuffix .o, $(basename $(JSON2PB_SOURCES)))

BRPC_DIRS = src/brpc src/brpc/details src/brpc/builtin src/brpc/handshake src/brpc/policy src/brpc/policy/mysql src/brpc/rdma
ifeq ($(WITH_URMA),1)
BRPC_DIRS += src/brpc/urma
endif
THRIFT_SOURCES = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/thrift*,$(SRCEXTS))))
EXCLUDE_SOURCES = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/event_dispatcher_*,$(SRCEXTS))))
BRPC_SOURCES_ALL = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS))))
ifeq ($(URMA_USE_MOCK),0)
BRPC_SOURCES_ALL := $(filter-out src/brpc/urma/mock_urma.cpp,$(BRPC_SOURCES_ALL))
endif
BRPC_SOURCES = $(filter-out $(THRIFT_SOURCES) $(EXCLUDE_SOURCES), $(BRPC_SOURCES_ALL))
BRPC_PROTOS = $(filter %.proto,$(BRPC_SOURCES))
BRPC_CFAMILIES = $(filter-out %.proto %.pb.cc,$(BRPC_SOURCES))
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.0
1.18.0
9 changes: 8 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,13 @@ http_archive(
urls = ["https://archive.apache.org/dist/thrift/0.15.0/thrift-0.15.0.tar.gz"],
)

git_repository(
name = "umdk",
build_file = "//bazel/third_party/umdk:umdk.BUILD",
remote = "https://atomgit.com/openeuler/umdk.git",
commit = "564ee727a55523d4351a8fb3c94292b388ebb924", # v26.06.0_CAM
)

# Header-only JSON library used by iobuf_unittest's IOBuf<->std::iostream
# adapter tests. Keep version in sync with MODULE.bazel.
http_archive(
Expand Down Expand Up @@ -317,4 +324,4 @@ http_archive(
sha256 = "3cd0e49f0f4a6d406c1d74b53b7616f5e24f5fd319eafc1bf8eee6e14124d115",
)
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
hedron_compile_commands_setup()
hedron_compile_commands_setup()
Loading
Loading