Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3cd5904
add ubring transport
zchuango Apr 13, 2026
0934567
fix the bug for ub ring transport
zchuango Apr 14, 2026
c52fe36
fix the bug for ub ring transport and other
zchuango Apr 14, 2026
37f8747
add the license for ub transport
zchuango Apr 14, 2026
350c305
Modifying the variable naming style
zchuango Apr 14, 2026
aa2a2f9
optimize the log message and some field name
zchuango Apr 19, 2026
fd91351
fix some bug for ubring
zchuango Apr 20, 2026
5998401
add some log ubring endpoint
zchuango Apr 23, 2026
e64f65c
add todo
zchuango May 6, 2026
d8c5e72
fix the bug for handshake for ub endpoint
zchuango May 7, 2026
312dafd
fix the bug for client ub endpoint
zchuango May 7, 2026
9002081
optimize the iobuf file code
zchuango May 7, 2026
e86b9ae
modify the log level
zchuango May 8, 2026
6c9ba54
fix the declare_shm_ubs define not found bug
zchuango May 8, 2026
102058c
add the timer_mgr support for macos and format code style
zchuango May 8, 2026
7050c53
fix the bug for macos epoll
zchuango May 8, 2026
8dacabe
fix the timespece bug
zchuango May 8, 2026
e1459d1
adaptor the itimerspec for macos platform
zchuango May 9, 2026
620b6e5
optimize the cmakelist config
zchuango May 9, 2026
e85ed8b
add the ubring docs for ubring transport
zchuango May 9, 2026
b1cdb99
modify some file name and directory structure
zchuango May 9, 2026
d8ddff8
Fix heap-use-after-free in ~AgentCombiner (#3291)
chenBright May 10, 2026
5cd340e
fix: add acquire fence in bthread_join for ARM memory visibility (#3276)
guoliushui May 11, 2026
654ae77
Fix protobuf version compatibility for ByteSizeLong() and SpaceUsedLo…
chenBright May 11, 2026
873cf62
Fix protobuf compilation errors (#3293)
chenBright May 12, 2026
6df15ac
modify some code style and optimize code logical
zchuango May 13, 2026
321c789
Fix(selective_channel): isolate backup responses and add race regress…
altman08 May 13, 2026
f48628d
Set up default protection ruleset for default and release branches (#…
asf-gitbox-commits May 16, 2026
08d95ac
Fix ASan stack range registration for main task (#3298)
chenBright May 17, 2026
e63a54d
release 1.17
Huixxi May 17, 2026
c2f5f0f
Add IBV_ACCESS_RELAXED_ORDERING for rdma reg mr
randomkang May 17, 2026
a72f880
Merge branch 'master' into opt_rdma_flags
randomkang May 17, 2026
58fec6f
[rdma] drain CQ after moving into RESET state (#3261)
live4thee May 18, 2026
9c2fc2f
reorg code
randomkang May 18, 2026
f85f1c5
Reimplement writer-priority RWLock (#3286)
chenBright May 19, 2026
4503a47
Fix bound SSL handshake to prevent leaked ESTABLISHED sockets (#3296)
yerixu May 20, 2026
3aa5dab
Fix UAF in batch_create_stream_feedback_race unittest (#3305)
chenBright May 20, 2026
2340a87
add the cmake ubshm transport ci/testing
zchuango May 23, 2026
72e398d
add the dependency header
zchuango May 23, 2026
d2b00da
bug fix the code
zchuango May 22, 2026
a47e349
fix(http): apply auth check to builtin requests on public port (#3308)
wwbmmm May 25, 2026
5dfb0b5
Fix code style
randomkang May 25, 2026
f97f23e
Hide libunwind's _Unwind_* symbols under Bazel to fix bthread_tracer …
chenBright May 27, 2026
477fa49
Fix UAF in SSLTest.connect_on_create (#3311)
chenBright May 27, 2026
ca98f85
Merge pull request #3300 from randomkang/opt_rdma_flags
yanglimingcn May 28, 2026
3c9ff52
fix: prevent null dereference in fuzz test socket initialization (#3314)
Felix-Gong May 28, 2026
781b822
update butil::default_block_size when rdma_recv_block_type is set
randomkang May 25, 2026
0835315
Merge pull request #3303 from randomkang/opt_default_block_size
yanglimingcn May 29, 2026
e9d4b19
Fix static initialization order fiasco in AdaptiveMaxConcurrency (#3315)
Felix-Gong May 29, 2026
c72e671
Fix UB shm allocation cleanup crashes (#11)
YChange01 May 29, 2026
8dae955
remove the brpc_ubshm_unittest
zchuango May 29, 2026
cd3948c
Refactor Bazel build with custom proto rules and build all test targe…
chenBright May 31, 2026
bf4d647
Merge pull request #3317 from apache/release-1.17
Huixxi May 31, 2026
49a15c2
optimize crc32c for riscv64 with Zbc carry-less multiplication (#3312)
Felix-Gong May 31, 2026
1d21b05
ci(linux): bring up redis-server and mysql-server for unittests (#3323)
rajvarun77 Jun 5, 2026
f98d5d0
Fix HTTPS pooled client crash on unexpected SSL EOF (#3316)
Felix-Gong Jun 5, 2026
9d5e5a7
Add threat model + security-model discoverability (AGENTS.md → SECURI…
potiuk Jun 5, 2026
af515cc
Fix guard SO_BINDTODEVICE (#3320)
daeho-ro Jun 5, 2026
72adb6e
Support RDMA handshake V3 (#3326)
chenBright Jun 5, 2026
c91666e
Merge branch 'master' into ubshm_transport_dev
zchuango Jun 8, 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
13 changes: 13 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ github:
issues: true
projects: false
discussions: true
rulesets:
- name: "Default Branch Protection"
type: branch
branches:
includes:
- "~DEFAULT_BRANCH"
- "release/*"
- "rel/*"
excludes: []
bypass_teams:
- root
restrict_deletion: true
restrict_force_push: true
9 changes: 8 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
./example/build_with_bazel
./example/build_with_bazel

# `registry/` is brpc's self-maintained Bzlmod registry. Its overlay
# BUILD.bazel files reference sources from the libunwind tarball that is
# only materialized at module resolution time, not in the source tree.
# Without this entry, `bazel build //...` would try to evaluate them as
# regular packages and fail with "missing input file ...".
./registry
53 changes: 49 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Bazel doesn't need more than 200MB of memory for local build based on memory profiling:
# https://docs.bazel.build/versions/master/skylark/performance.html#memory-profiling
# The default JVM max heapsize is 1/4 of physical memory up to 32GB which could be large
# enough to consume all memory constrained by cgroup in large host.
# Limiting JVM heapsize here to let it do GC more when approaching the limit to
# leave room for compiler/linker.
# The number 3G is chosen heuristically to both support large VM and small VM with RBE.
# Startup options cannot be selected via config.
startup --host_jvm_args=-Xmx3g
startup --host_jvm_args="-DBAZEL_TRACK_SOURCE_DIRECTORIES=1"

# Default build options. These are applied first and unconditionally.
#
common --registry=https://bcr.bazel.build
common --registry=https://baidu.github.io/babylon/registry
common --registry=https://raw.githubusercontent.com/apache/brpc/master/registry

build --verbose_failures
# Keep SHT_SYMTAB in built binaries so google::Symbolize can resolve
# in-binary functions (e.g. TestBody() in test binaries) by name
# instead of falling back to "<unknown>". Bazel's default
# `--strip=sometimes` strips debug/symbol sections in fastbuild mode,
# which is what `bazel test` uses unless `-c dbg` is given.
build --strip=never
build --cxxopt="-std=c++17"
build --copt="-fno-omit-frame-pointer"
# Use gnu17 for asm keyword.
Expand All @@ -33,12 +50,40 @@ build --features=per_object_debug_info
# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace.
build --define absl=1

# For brpc.
test --define=BRPC_BUILD_FOR_UNITTEST=true
build:rdma --define BRPC_WITH_RDMA=true

# For UT.
build:test --define BRPC_BUILD_FOR_UNITTEST=true
# Hide libunwind's `_Unwind_*` symbols so they don't preempt libgcc_s at
# runtime. Without this, pthread_exit / C++ exception unwinding crashes
# when libunwind.so appears earlier in the dynamic link chain.
# See registry/modules/1.8.1/overlay/BUILD.bazel for details.
build:test --define with_bthread_tracer=false
build:test --define libunwind_hide_unwind_symbols=true

test --config=test
test --test_output=streamed

# Pass PATH, CC, CXX and LLVM_CONFIG variables from the environment.
build --action_env=CC
build --action_env=CXX
build --action_env=LLVM_CONFIG
build --action_env=PATH

# Basic ASAN
build:asan --define=with_asan=true
build:asan --copt -fsanitize=address
build:asan --linkopt -fsanitize=address
# ASAN needs -O1 to get reasonable performance.
build:asan --copt -O1
build:asan --copt -fno-optimize-sibling-calls

# macOS ASAN
build:macos-asan --config=asan
# Workaround, see https://github.com/bazelbuild/bazel/issues/6932
build:macos-asan --copt -Wno-macro-redefined
build:macos-asan --copt -D_FORTIFY_SOURCE=0
# Dynamic link cause issues like: `dyld: malformed mach-o: load commands size (59272) > 32768`
build:macos-asan --dynamic_mode=off

test:asan --test_env=ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=1
2 changes: 1 addition & 1 deletion .github/actions/install-all-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ runs:
using: "composite"
steps:
- uses: ./.github/actions/install-essential-dependencies
- run: sudo apt-get update && sudo apt-get install -y libunwind-dev libgoogle-glog-dev automake bison flex libboost-all-dev libevent-dev libtool pkg-config libibverbs1 libibverbs-dev
- run: sudo apt-get update && sudo apt-get install -y libunwind-dev libgoogle-glog-dev automake bison flex libboost-all-dev libevent-dev libtool pkg-config libibverbs-dev
shell: bash
- run: |
wget https://archive.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz && cd thrift-0.11.0/
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/install-essential-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ runs:
steps:
- run: ulimit -c unlimited -S && sudo bash -c "echo 'core.%e.%p' > /proc/sys/kernel/core_pattern"
shell: bash
- run: sudo apt-get update && sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev
- run: sudo apt-get update && sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev redis-server mysql-server libibverbs-dev
shell: bash
- run: redis-server --version && mysqld --version
shell: bash
92 changes: 60 additions & 32 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
- name: gcc with all options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=gcc --cxx=g++ --werror --with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety --with-debug-lock --with-bthread-tracer --with-asan
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=gcc --cxx=g++ --werror \
--with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety \
--with-debug-lock --with-bthread-tracer --with-asan

- name: clang with default options
uses: ./.github/actions/compile-with-make
Expand All @@ -39,7 +41,9 @@ jobs:
- name: clang with all options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=clang --cxx=clang++ --werror --with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety --with-debug-lock --with-bthread-tracer --with-asan
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=clang --cxx=clang++ --werror \
--with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety \
--with-debug-lock --with-bthread-tracer --with-asan

compile-with-cmake:
runs-on: ubuntu-22.04
Expand All @@ -57,7 +61,9 @@ 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 -DWITH_DEBUG_BTHREAD_SCHE_SAFETY=ON -DWITH_DEBUG_LOCK=ON -DWITH_BTHREAD_TRACER=ON -DWITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=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

- name: clang with default options
Expand All @@ -70,7 +76,9 @@ jobs:
run: |
export CC=clang && export CXX=clang++
mkdir clang_build_all && cd clang_build_all
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON -DWITH_DEBUG_BTHREAD_SCHE_SAFETY=ON -DWITH_DEBUG_LOCK=ON -DWITH_BTHREAD_TRACER=ON -DWITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
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

gcc-compile-with-make-protobuf:
Expand Down Expand Up @@ -103,33 +111,32 @@ jobs:
protobuf-install-dir: /protobuf-3.21.12
config-brpc-options: --cc=gcc --cxx=g++ --werror

gcc-compile-with-bazel:
gcc-unittest-with-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures -- //... -//example/...

gcc-compile-with-boringssl:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --define with_mesalink=false --define with_glog=true --define with_thrift=true --define BRPC_WITH_BORINGSSL=true -- //... -//example/...
# Install redis-server/mysql-server so the integration tests that fork a
# 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/...

gcc-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: |
bazel build --verbose_failures \
--define with_mesalink=false \
bazel build --define with_mesalink=false \
--define with_glog=true \
--define with_thrift=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 \
-- //... -//example/...
--define with_babylon_counter=true \
-- //:brpc

clang-compile-with-make-protobuf:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -161,34 +168,35 @@ jobs:
protobuf-install-dir: /protobuf-3.21.12
config-brpc-options: --cc=clang --cxx=clang++ --werror

clang-compile-with-bazel:
clang-unittest-with-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --action_env=CC=clang -- //... -//example/...

clang-compile-with-boringssl:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --action_env=CC=clang --define with_mesalink=false --define with_glog=true --define with_thrift=true --define BRPC_WITH_BORINGSSL=true -- //... -//example/...
# Install redis-server/mysql-server so the forked-server integration tests
# actually run under bazel (see gcc-unittest-with-bazel).
- uses: ./.github/actions/install-essential-dependencies
- run: |
bazel test --test_output=streamed \
--action_env=CC=clang \
//test/...

clang-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: |
bazel build --verbose_failures \
--action_env=CC=clang \
bazel build --action_env=CC=clang \
--define with_mesalink=false \
--define with_glog=true \
--define with_thrift=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 \
-- //... -//example/...
--define with_babylon_counter=true \
-- //:brpc

clang-unittest:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -224,13 +232,33 @@ jobs:
- name: run tests
run: |
cd test
sh ./run_tests.sh
# The redis integration tests (sanity/keys_with_spaces/incr_and_decr/by_components/auth)
# fork a real redis-server and connect after a fixed 50ms wait; under ASan redis starts
# too slowly, so they flake here (connection refused). Skip just those under ASan; the
# redis codec/server tests still run, and the full suite runs in clang-unittest.
GTEST_FILTER='-RedisTest.sanity:RedisTest.keys_with_spaces:RedisTest.incr_and_decr:RedisTest.by_components:RedisTest.auth' sh ./run_tests.sh

bazel-bvar-unittest:
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.
USE_BAZEL_VERSION: "8.3.1"
steps:
- uses: actions/checkout@v2
- run: bazel test --verbose_failures //test:bvar_test
- run: bazel test --verbose_failures --define with_babylon_counter=true //test:bvar_test
- run: bazel test --verbose_failures --action_env=CC=clang //test:bvar_test
- run: bazel test --verbose_failures --action_env=CC=clang --define with_babylon_counter=true //test:bvar_test
# Install redis-server/mysql-server so the forked-server integration tests
# actually run under bazel (see gcc-unittest-with-bazel).
- uses: ./.github/actions/install-essential-dependencies
- name: Override protobuf version for testing
run: |
sed -i -E "s/(bazel_dep\(name = ['\"]protobuf['\"], version = ['\"])[^'\"]+/\1${TEST_PROTOBUF_VERSION}/" MODULE.bazel
echo "After override:"
grep -E "bazel_dep\(name = ['\"]protobuf['\"]" MODULE.bazel
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 \
--define with_babylon_counter=true \
//test/... --test_arg=--gtest_filter=-RdmaRpcTest.*
4 changes: 2 additions & 2 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: compile with cmake
run: |
echo "CMAKE_PREFIX_PATH=$(brew --prefix protobuf@21)"
mkdir build && cd build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_PREFIX_PATH=$(brew --prefix protobuf@21) ..
mkdir build && cd build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DWITH_UBRING=ON -DCMAKE_PREFIX_PATH=$(brew --prefix protobuf@21) ..
make -j ${{env.proc_num}} && make clean

compile-with-make-cmake-protobuf29:
Expand All @@ -56,7 +56,7 @@ jobs:

- name: compile with cmake
run: |
mkdir build && cd build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_PREFIX_PATH=$(brew --prefix protobuf@29) ..
mkdir build && cd build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DWITH_UBRING=ON -DCMAKE_PREFIX_PATH=$(brew --prefix protobuf@29) ..
make -j ${{env.proc_num}} && make clean

compile-with-bazel:
Expand Down
3 changes: 3 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,7 @@ header:
# Fuzzing seed
- 'test/fuzzing/fuzz_*_seed_corpus/*'

# bazel-central-registry
- 'registry/**'

comment: on-failure
27 changes: 27 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Agent Guide for brpc

This file is read by automated agents (security scanners, code
analyzers, AI assistants) operating on this repository.

## Security

Security model: [SECURITY.md](./SECURITY.md)

Agents that scan this repository should consult `SECURITY.md` and the
threat model it links before reporting issues.
Loading
Loading