| Run Bazel tests in parallel in CI (#3482) * Run Bazel tests in parallel in CI * Use an ephemeral port in interceptor test * Use an ephemeral port in HTTP expect test * Set protobuf JSON test timeout explicitly * Use an ephemeral port in endpoint test * Use an ephemeral port in oversized message test * Isolate additional timing-sensitive Bazel tests Run the channel and SSL test binaries exclusively. They rely on strict timing or process-wide networking state and can fail when competing with parallel test processes. * Avoid restoring incompatible Bazel caches Limit fallback restoration to caches produced by the same CI job. The broad fallback could restore a cache from a different compiler or protobuf setup, which produced no hits while consuming transfer time and cache capacity. | 2 months ago |
| feat: add URMA transport support (#3428) * Add URMA transport support * fix: address review comments on naming, IOBuf sizing and UMDK pinning - Rename ack_bit_is_rdma_ok to ack_bit_is_urma_ok. - Replace hard-coded IOBuf block header size with sizeof(butil::IOBuf::Block). - Pin UMDK dependency to a specific commit instead of a mutable tag. * modify the bazel docs and refine the ut * add DOWNLOAD_URMA_HEADERS lacks Bazel build support * Fix Bazel URMA mock source selection * Fix URMA review issues after input refactor * Clarify Bazel URMA source selection * force Restore InputMessenger formatting * reformat the code base on master --------- Co-authored-by: Winchell <cw20050111@gmail.com> Co-authored-by: Gzure <740684863@qq.com> | 1 month ago |
| fix(cmake): require all BoringSSL components (#3594) Fail during dependency discovery when WITH_BORINGSSL is enabled and required components are missing. Check the include directory, SSL library, and Crypto library separately to avoid reporting success for an incomplete library list. | 1 month ago |
| Update new commiter doc (#3555) | 1 month ago |
| fix(redis): avoid formatted command overread (#3570) Retry formatted values in dynamically sized storage when vsnprintf reports an output larger than the stack buffer. Add a vector-based RedisRequest component overload and use it for authentication and cluster command construction while retaining the existing format APIs. Add coverage for wide numeric formatting, binary-safe components, and AUTH/SELECT credential encoding. Verified with RedisCommandFormatTest.* and RedisClusterChannelTest.basic_routing_and_multi_key_commands. | 1 month ago |
| Fix wrong project and target names in auto_concurrency_limiter example CMakeLists (#3565) | 1 month ago |
| Fix macos ci failed with protobuf version (#2287) | 3 years ago |
| Add empty folder of python and java | 9 years ago |
| Release Apache bRPC 1.18.0 (#3550) | 1 month ago |
| Add empty folder of python and java | 9 years ago |
| Refactor Bazel build with custom proto rules and build all test targets (#3313) | 5 months ago |
| Add IPC_V2 data path for UBRing IPC (#3573) * Add IPC_V2 data path for UBRing IPC * Move IPC_V2 ring implementation out of header --------- Co-authored-by: BGQ99 <1132767344@qq.com> | 1 month ago |
| Add IPC_V2 data path for UBRing IPC (#3573) * Add IPC_V2 data path for UBRing IPC * Move IPC_V2 ring implementation out of header --------- Co-authored-by: BGQ99 <1132767344@qq.com> | 1 month ago |
| fix: release AccessThreadArgs array in parallel_http to avoid memory leak (#2793) (#3491) | 2 months ago |
| Set up default protection ruleset for default and release branches (#3299) | 6 months ago |
| Fix brpc_proto_library failure when brpc is used as an external Bazel dependency (#3427) | 3 months ago |
| build: complete UBRING Bazel and CI support (#3445) Add the missing BRPC_WITH_UBRING Bazel configuration, wire it through the library and example targets, and document the supported build commands. Enable RDMA and UBRING in CI jobs whose all-options configurations did not exercise those features. Run both feature suites in the existing Bazel unit-test jobs and enable RDMA in the Make unit-test job. Use unsigned literals for UBRING atomic counter operations to match the counter type and avoid template deduction failures on stricter compilers. Signed-off-by: Zhengwei Zhu <141622927+ZhengweiZhu@users.noreply.github.com> | 3 months ago |
| bump bzlmod version to 1.10.0 (#2705) * bump bzlmod version to 1.10.0 * bump bazel version to 7.2.1 * fix code style in MODULE.bazel | 2 years ago |
| Reuse standard CMake build directory in docs (#3552) | 1 month ago |
| Fix brpc_proto_library failure when brpc is used as an external Bazel dependency (#3427) | 3 months ago |
| docs(agents): guide contributors through repository workflows (#3370) Replace the minimal agent note with a concise contributor guide tailored to the brpc repository. The guide captures structure, build and test commands, coding style, testing expectations, PR guidance, and security reminders. | 4 months ago |
| Support higher performance histogram (#3561) * Support higher performance histogram * Fix some issues | 1 month ago |
| remove changelog for 0.9.8rc01, waiting for 0.9.8 final release | 6 years ago |
| Release Apache bRPC 1.18.0 (#3550) | 1 month ago |
| fix(cmake): require all BoringSSL components (#3594) Fail during dependency discovery when WITH_BORINGSSL is enabled and required components are missing. Check the include directory, SSL library, and Crypto library separately to avoid reporting success for an incomplete library list. | 1 month ago |
| Update CODE_OF_CONDUCT.md (#1971) | 3 years ago |
| update project links (#2200) - brpc/brpc -> apache/brpc | 3 years ago |
| Remove incubator in svn and download path (#2079) * Remove incubator in svn and download path | 3 years ago |
| Hide libunwind's _Unwind_* symbols under Bazel to fix bthread_tracer crash (#3297) libunwind ships its src/unwind/*.c (the GCC _Unwind_* ABI compatibility layer) as exported symbols of libexternal_S~libunwind.so. At runtime the dynamic loader resolves _Unwind_* lookups (from pthread_exit, libstdc++'s __gxx_personality_v0, etc.) to libunwind's DWARF-based implementation instead of libgcc_s.so.1, hitting an uninitialized internal context and crashing on the no-return cleanup chain triggered by pthread_exit / C++ exception unwinding -- e.g. it makes BthreadTest.bthread_exit segfault deterministically when --define=with_bthread_tracer=true is on. This is purely an ELF runtime symbol-resolution-order issue and reproduces identically on GCC and Clang, since both default to libstdc++ + libgcc_s on Linux. | 5 months ago |
| feat: add URMA transport support (#3428) * Add URMA transport support * fix: address review comments on naming, IOBuf sizing and UMDK pinning - Rename ack_bit_is_rdma_ok to ack_bit_is_urma_ok. - Replace hard-coded IOBuf block header size with sizeof(butil::IOBuf::Block). - Pin UMDK dependency to a specific commit instead of a mutable tag. * modify the bazel docs and refine the ut * add DOWNLOAD_URMA_HEADERS lacks Bazel build support * Fix Bazel URMA mock source selection * Fix URMA review issues after input refactor * Clarify Bazel URMA source selection * force Restore InputMessenger formatting * reformat the code base on master --------- Co-authored-by: Winchell <cw20050111@gmail.com> Co-authored-by: Gzure <740684863@qq.com> | 1 month ago |
| feat: add URMA transport support (#3428) * Add URMA transport support * fix: address review comments on naming, IOBuf sizing and UMDK pinning - Rename ack_bit_is_rdma_ok to ack_bit_is_urma_ok. - Replace hard-coded IOBuf block header size with sizeof(butil::IOBuf::Block). - Pin UMDK dependency to a specific commit instead of a mutable tag. * modify the bazel docs and refine the ut * add DOWNLOAD_URMA_HEADERS lacks Bazel build support * Fix Bazel URMA mock source selection * Fix URMA review issues after input refactor * Clarify Bazel URMA source selection * force Restore InputMessenger formatting * reformat the code base on master --------- Co-authored-by: Winchell <cw20050111@gmail.com> Co-authored-by: Gzure <740684863@qq.com> | 1 month ago |
| Release 1.16.0 | 9 months ago |
| Interconnecting with the UBShmTransport Based on the LD/ST Shared Memory Semantics. (#3290) * add ubring transport * fix the bug for ub ring transport * fix the bug for ub ring transport and other * add the license for ub transport * Modifying the variable naming style * optimize the log message and some field name * fix some bug for ubring * add some log ubring endpoint * add todo * fix the bug for handshake for ub endpoint * fix the bug for client ub endpoint * optimize the iobuf file code * modify the log level * fix the declare_shm_ubs define not found bug * add the timer_mgr support for macos and format code style * fix the bug for macos epoll * fix the timespece bug * adaptor the itimerspec for macos platform * optimize the cmakelist config * add the ubring docs for ubring transport * modify some file name and directory structure * modify some code style and optimize code logical * add the cmake ubshm transport ci/testing * add the dependency header * bug fix the code * Fix UB shm allocation cleanup crashes (#11) Co-authored-by: 郭业昌 <lvpengfei@MacBook-Air.local> * remove the brpc_ubshm_unittest * Found and fixed two stability issues (#13) * 修复ubring server端关闭连接coredump问题 * 修复PollIn/PollOut解引用已释放Socket指针的问题 PollIn/PollOut通过ep->_socket(裸指针)读取data socket,当data socket 被销毁时该指针悬空,导致Socket::Address读到垃圾id触发SIGSEGV。 改为存储_socket_id(SocketId),用Address获取引用计数的Socket, 并在整个回调期间持有该引用,避免解引用悬空指针。 * 修复client非正常退出导致UBRING shm残留的问题 client被强杀(SIGTERM/崩溃/OOM)时teardown没跑完,localShm(_C)的 shm_unlink未执行,导致/dev/shm残留_C文件。server的remoteShm只munmap 不unlink(正确),无法清理client的名字。 在握手ESTABLISHED时(client/server都确认对方已mmap自己的localShm) 立即unlink localShm名字。此时对端已持有mmap引用,unlink只删名字不 影响通信;进程任意时刻退出都不会残留文件名。 * Address chenBright's review: use English comments and BAIDU_CACHELINE_ALIGNMENT - Convert all Chinese comments in ubshm to English (per chenBright's 'Please use English' on ub_endpoint.cpp:723, ub_ring.cpp:337, shm_ubs.cpp:316, and similar) - Replace __attribute__((aligned(64))) with BAIDU_CACHELINE_ALIGNMENT in ubr_msg.h (per chenBright's comment on ubr_msg.h:41) - Remove unnecessary TODO comment in ub_ring.cpp:551 (per chenBright's 'Unnecessary comments, please delete') * Remove unused lock macros in thread_lock.h Per chenBright's review, the functions and macros defined in thread_lock.h are largely unused. Verified usage across ubshm: - LOCK_GUARD / UnlockMutex: 8 call sites in shm_ubs.cpp and ub_ring_manager.cpp, kept. - SPIN_LOCK_GUARD, R_LOCK_GUARD, W_LOCK_GUARD, SEMAPHORE_WAIT_GUARD, SEMAPHORE_WAIT_GUARD_WITH_CLOSE and their helper functions (UnlockSpinLock, UnlockRWLock, PostSem, PostSemWithClose): 0 call sites, removed. * Apply chenBright's review on timer_mgr globals Per chenBright's review on timer_mgr.cpp:32-37: - Add explicit default values to uninitialized globals (g_total_timer_num=0, g_max_system_fd=0, g_epoll_execute_thread=0, g_timer_module_initialized=0) - Rename globals to snake_case (g_epollFd -> g_epoll_fd, g_totalTimerNum -> g_total_timer_num, g_timerFdCtxMap -> g_timer_fd_ctx_map, maxSystemFd -> g_max_system_fd, g_epollExecuteThread -> g_epoll_execute_thread, g_timerModuleInitialized -> g_timer_module_initialized) - maxSystemFd also gains the g_ prefix to match global naming style Also fix the missing std:: qualifier on atomic_fetch_sub/add/load (per chenBright's earlier comment on timer_mgr.cpp:80). * Change CloseTimerFd fd type from uint32_t to int Per chenBright's review on timer_mgr.cpp:399 (uint32_t -> int). fd is a system file descriptor; POSIX APIs use int and -1 denotes an invalid fd, which uint32_t cannot represent. Changed the CloseTimerFd signature (header + definition) and removed the now-unnecessary (uint32_t) casts at the two call sites. * Use BAIDU_LIKELY/BAIDU_UNLIKELY instead of custom __builtin_expect Per chenBright's review on common.h:27. Rather than redefine the macros with __builtin_expect directly, forward LIKELY/UNLIKELY to brpc's standard BAIDU_LIKELY/BAIDU_UNLIKELY (from butil/compiler_specific.h). The 122 call sites keep using LIKELY()/UNLIKELY() unchanged; only the macro bodies change, preserving semantics. * Add unit tests for UBShmEndpoint Per chenBright's request to add unit tests for UBShmTransport in this PR (rather than a follow-up). Adds test/brpc_ubring_unittest.cpp with tests covering the public interface of UBShmEndpoint under the g_skip_ub_init=true mode (which skips real shared-memory/poller setup): - construct_and_destruct: lifecycle safety - is_writable_false_when_skip_init: skip-mode behavior - reset_is_idempotent: Reset() is safe to call repeatedly The file follows the brpc_*_unittest.cpp naming convention so it is auto-collected by test/CMakeLists.txt's file(GLOB). Verified: compiles, links, and all 3 tests pass (g++ 15.2, C++17, gtest, BRPC_WITH_UBRING=ON). * Rewrite UBShmEndpoint unit tests with real coverage Per chenBright's feedback that the previous tests were too simple and did not cover the main methods. Source changes to enable testing: - Move HelloMessage struct declaration from ub_endpoint.cpp to ub_endpoint.h so tests can access it - Expose private members under #ifdef UNIT_TEST (precedent: butil/containers/stack_container.h) so tests can call AllocateClientResources without -Dprivate=public (which breaks GCC 15 + new libstdc++ <any>/<sstream>) Tests (9, all passing on Ubuntu 26.04 g++ 15.2 C++17 gtest): HelloMessageTest (5): serialize/deserialize roundtrip, network byte order verification, uint64 max boundary, full shm_name, toString UBShmEndpointTest (4): construct, real IPC shm AllocateClientResources (g_skip_ub_init=false), reset cleanup, reset idempotency * rename the variable to snake_case style --------- Co-authored-by: YeChang Guo <52730608+YChange01@users.noreply.github.com> Co-authored-by: 郭业昌 <lvpengfei@MacBook-Air.local> Co-authored-by: gure <740684863@qq.com> | 3 months ago |
| Interconnecting with the UBShmTransport Based on the LD/ST Shared Memory Semantics. (#3290) * add ubring transport * fix the bug for ub ring transport * fix the bug for ub ring transport and other * add the license for ub transport * Modifying the variable naming style * optimize the log message and some field name * fix some bug for ubring * add some log ubring endpoint * add todo * fix the bug for handshake for ub endpoint * fix the bug for client ub endpoint * optimize the iobuf file code * modify the log level * fix the declare_shm_ubs define not found bug * add the timer_mgr support for macos and format code style * fix the bug for macos epoll * fix the timespece bug * adaptor the itimerspec for macos platform * optimize the cmakelist config * add the ubring docs for ubring transport * modify some file name and directory structure * modify some code style and optimize code logical * add the cmake ubshm transport ci/testing * add the dependency header * bug fix the code * Fix UB shm allocation cleanup crashes (#11) Co-authored-by: 郭业昌 <lvpengfei@MacBook-Air.local> * remove the brpc_ubshm_unittest * Found and fixed two stability issues (#13) * 修复ubring server端关闭连接coredump问题 * 修复PollIn/PollOut解引用已释放Socket指针的问题 PollIn/PollOut通过ep->_socket(裸指针)读取data socket,当data socket 被销毁时该指针悬空,导致Socket::Address读到垃圾id触发SIGSEGV。 改为存储_socket_id(SocketId),用Address获取引用计数的Socket, 并在整个回调期间持有该引用,避免解引用悬空指针。 * 修复client非正常退出导致UBRING shm残留的问题 client被强杀(SIGTERM/崩溃/OOM)时teardown没跑完,localShm(_C)的 shm_unlink未执行,导致/dev/shm残留_C文件。server的remoteShm只munmap 不unlink(正确),无法清理client的名字。 在握手ESTABLISHED时(client/server都确认对方已mmap自己的localShm) 立即unlink localShm名字。此时对端已持有mmap引用,unlink只删名字不 影响通信;进程任意时刻退出都不会残留文件名。 * Address chenBright's review: use English comments and BAIDU_CACHELINE_ALIGNMENT - Convert all Chinese comments in ubshm to English (per chenBright's 'Please use English' on ub_endpoint.cpp:723, ub_ring.cpp:337, shm_ubs.cpp:316, and similar) - Replace __attribute__((aligned(64))) with BAIDU_CACHELINE_ALIGNMENT in ubr_msg.h (per chenBright's comment on ubr_msg.h:41) - Remove unnecessary TODO comment in ub_ring.cpp:551 (per chenBright's 'Unnecessary comments, please delete') * Remove unused lock macros in thread_lock.h Per chenBright's review, the functions and macros defined in thread_lock.h are largely unused. Verified usage across ubshm: - LOCK_GUARD / UnlockMutex: 8 call sites in shm_ubs.cpp and ub_ring_manager.cpp, kept. - SPIN_LOCK_GUARD, R_LOCK_GUARD, W_LOCK_GUARD, SEMAPHORE_WAIT_GUARD, SEMAPHORE_WAIT_GUARD_WITH_CLOSE and their helper functions (UnlockSpinLock, UnlockRWLock, PostSem, PostSemWithClose): 0 call sites, removed. * Apply chenBright's review on timer_mgr globals Per chenBright's review on timer_mgr.cpp:32-37: - Add explicit default values to uninitialized globals (g_total_timer_num=0, g_max_system_fd=0, g_epoll_execute_thread=0, g_timer_module_initialized=0) - Rename globals to snake_case (g_epollFd -> g_epoll_fd, g_totalTimerNum -> g_total_timer_num, g_timerFdCtxMap -> g_timer_fd_ctx_map, maxSystemFd -> g_max_system_fd, g_epollExecuteThread -> g_epoll_execute_thread, g_timerModuleInitialized -> g_timer_module_initialized) - maxSystemFd also gains the g_ prefix to match global naming style Also fix the missing std:: qualifier on atomic_fetch_sub/add/load (per chenBright's earlier comment on timer_mgr.cpp:80). * Change CloseTimerFd fd type from uint32_t to int Per chenBright's review on timer_mgr.cpp:399 (uint32_t -> int). fd is a system file descriptor; POSIX APIs use int and -1 denotes an invalid fd, which uint32_t cannot represent. Changed the CloseTimerFd signature (header + definition) and removed the now-unnecessary (uint32_t) casts at the two call sites. * Use BAIDU_LIKELY/BAIDU_UNLIKELY instead of custom __builtin_expect Per chenBright's review on common.h:27. Rather than redefine the macros with __builtin_expect directly, forward LIKELY/UNLIKELY to brpc's standard BAIDU_LIKELY/BAIDU_UNLIKELY (from butil/compiler_specific.h). The 122 call sites keep using LIKELY()/UNLIKELY() unchanged; only the macro bodies change, preserving semantics. * Add unit tests for UBShmEndpoint Per chenBright's request to add unit tests for UBShmTransport in this PR (rather than a follow-up). Adds test/brpc_ubring_unittest.cpp with tests covering the public interface of UBShmEndpoint under the g_skip_ub_init=true mode (which skips real shared-memory/poller setup): - construct_and_destruct: lifecycle safety - is_writable_false_when_skip_init: skip-mode behavior - reset_is_idempotent: Reset() is safe to call repeatedly The file follows the brpc_*_unittest.cpp naming convention so it is auto-collected by test/CMakeLists.txt's file(GLOB). Verified: compiles, links, and all 3 tests pass (g++ 15.2, C++17, gtest, BRPC_WITH_UBRING=ON). * Rewrite UBShmEndpoint unit tests with real coverage Per chenBright's feedback that the previous tests were too simple and did not cover the main methods. Source changes to enable testing: - Move HelloMessage struct declaration from ub_endpoint.cpp to ub_endpoint.h so tests can access it - Expose private members under #ifdef UNIT_TEST (precedent: butil/containers/stack_container.h) so tests can call AllocateClientResources without -Dprivate=public (which breaks GCC 15 + new libstdc++ <any>/<sstream>) Tests (9, all passing on Ubuntu 26.04 g++ 15.2 C++17 gtest): HelloMessageTest (5): serialize/deserialize roundtrip, network byte order verification, uint64 max boundary, full shm_name, toString UBShmEndpointTest (4): construct, real IPC shm AllocateClientResources (g_skip_ub_init=false), reset cleanup, reset idempotency * rename the variable to snake_case style --------- Co-authored-by: YeChang Guo <52730608+YChange01@users.noreply.github.com> Co-authored-by: 郭业昌 <lvpengfei@MacBook-Air.local> Co-authored-by: gure <740684863@qq.com> | 3 months ago |
| Release Apache bRPC 1.18.0 (#3550) | 1 month ago |
| Add threat model + security-model discoverability (AGENTS.md → SECURITY.md → THREAT_MODEL.md) (#3324) * Add threat model + security-model discoverability (AGENTS.md → SECURITY.md → THREAT_MODEL.md) Generated-by: Claude Code * THREAT_MODEL.md: renumber out-of-scope threats list to start at 1 Per review (chenBright) — the "Threats explicitly out of scope" list was continuing the previous list's numbering (8-15); restart at 1-8. Generated-by: Claude Code | 5 months ago |
| build(cxx): align all builds on a C++14 baseline (#3419) * build(cxx): align all builds on a C++14 baseline CMake, Make, tests, tools, and examples now require C++14 so every supported build path shares the same minimum language level. The compiler checks and user-facing documentation reflect that baseline. * fix(test): keep cores scoped to the failing test Clear prior cores before each test binary. A passing death test can leave a core that would otherwise be used to diagnose an unrelated later failure. * revert src/butil/type_traits.h | 3 months ago |
| feat: add URMA transport support (#3428) * Add URMA transport support * fix: address review comments on naming, IOBuf sizing and UMDK pinning - Rename ack_bit_is_rdma_ok to ack_bit_is_urma_ok. - Replace hard-coded IOBuf block header size with sizeof(butil::IOBuf::Block). - Pin UMDK dependency to a specific commit instead of a mutable tag. * modify the bazel docs and refine the ut * add DOWNLOAD_URMA_HEADERS lacks Bazel build support * Fix Bazel URMA mock source selection * Fix URMA review issues after input refactor * Clarify Bazel URMA source selection * force Restore InputMessenger formatting * reformat the code base on master --------- Co-authored-by: Winchell <cw20050111@gmail.com> Co-authored-by: Gzure <740684863@qq.com> | 1 month ago |
| bump bzlmod version to 1.10.0 (#2705) * bump bzlmod version to 1.10.0 * bump bazel version to 7.2.1 * fix code style in MODULE.bazel | 2 years ago |
| cputime optimize for arm64 (#3247) * cputime optimize for arm64 Update src/butil/time.cpp modify using __attribute__((constructor)) and merge init_invariant_cpu_freq to inside function read_invariant_cpu_frequency * Add the macro switch BUTIL_USE_CPU_FREQUENCY while preserving the original default behavior for ARM64 * 1、Activation options: CMake -DWITH_CPU_FREQUENCY=ON, Bazel --define BUTIL_USE_CPU_FREQUENCY=true, script argument --with-cpu-frequency. 2、Disabled by default for consistent legacy behavior. * fix compile failed --------- Co-authored-by: seekdwh <dongweihao@huawei.com> | 3 months ago |
| feat: add URMA transport support (#3428) * Add URMA transport support * fix: address review comments on naming, IOBuf sizing and UMDK pinning - Rename ack_bit_is_rdma_ok to ack_bit_is_urma_ok. - Replace hard-coded IOBuf block header size with sizeof(butil::IOBuf::Block). - Pin UMDK dependency to a specific commit instead of a mutable tag. * modify the bazel docs and refine the ut * add DOWNLOAD_URMA_HEADERS lacks Bazel build support * Fix Bazel URMA mock source selection * Fix URMA review issues after input refactor * Clarify Bazel URMA source selection * force Restore InputMessenger formatting * reformat the code base on master --------- Co-authored-by: Winchell <cw20050111@gmail.com> Co-authored-by: Gzure <740684863@qq.com> | 1 month ago |