137 Commits

Author SHA1 Message Date
Bright Chen 93f6692ebb Refactor NULL with nullptr in tools (#3465) 2026-08-19 23:03:24 +08:00
darion-yaphet 0313102276 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
2026-08-06 17:34:49 +08:00
rajvarun77 32c95225e8 Add Power-of-Two-Choices Peak-EWMA load balancer (p2c) (#3367)
* Add Power-of-Two-Choices Peak-EWMA load balancer (p2c)

Implements the p2c load balancing policy proposed in #3340: each
selection samples two random servers (configurable via choices=N) and
routes to the lower peak-EWMA latency * (inflight+1) / weight score.
Upward latency spikes take effect immediately while recovery decays
over tau_ms (default 10s), so a degraded server is shed within one
observation at O(1) selection cost.

Uses only existing LoadBalancer hooks (SelectServer/Feedback,
need_feedback) with DoublyBufferedData membership like rr/la; per-node
stats are shared_ptr-owned by both buffers. Registered as "p2c" in
global.cpp. Includes unit tests (functional, weighted, exclusion,
error punishment, concurrency churn) and docs in cn/en client.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Reuse SelectIn.begin_time_us to avoid extra clock read per selection

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Address review: gflags for tunables, cap error punishment, drop FlatMap init

- p2c_default_choices/p2c_default_tau_ms gflags as channel-overridable defaults
- p2c_max_punish_ms(default 30s) caps the doubled-EWMA error punishment so a
  persistently failing server recovers in bounded time after turning healthy
- Servers::server_map relies on FlatMap small-map auto-init
- tests: error_punish_is_capped + feedback_lock_overhead benchmark

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: rajvarun77 <287367605+rajvarun77@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:41:54 +08:00
darion-yaphet 82a6819297 build(cmake): Modernize target-scoped CMake configuration (#3377)
* build(cmake): keep modern CMake policy compatibility

Raise the minimum CMake version range to 3.16...3.28 so CMake 4.x no longer treats the project as relying on removed pre-3.5 policy compatibility. The range preserves a conservative 3.16 runtime floor while documenting policy validation through 3.28.

* build(cmake): modernize target-scoped CMake configuration

Move shared compile definitions, include paths, options, and link dependencies onto interface targets so top-level, src, tools, tests, and standalone examples consume consistent build settings without relying on global directory state.

Examples now share a small CMake helper, and the gtest download path is updated to configure with modern CMake while keeping downloaded gtest headers ahead of Homebrew's C++17-only installation.
2026-07-12 00:02:52 +08:00
Bright Chen 12fb539a1c Use monotonic time instead of wall time (#3268) 2026-04-13 14:14:03 +08:00
Searion 2e19784539 fix gdb_bthread_stack bthread_begin error (#3176)
Co-authored-by: Haigang Xi <xhgang@blackwingasset.com>
2025-12-18 10:46:46 +08:00
Bright Chen 0608aa1e13 Fix gflag namespace of example and tools (#2879) 2025-01-19 21:28:55 +08:00
Xiaofeng Wang 282776acaf Add NonreflectableMessage and support Protobuf v5 (#2782)
* Add NonreflectableMessage and support Protobuf v5

See https://github.com/apache/brpc/pull/2722#issuecomment-2272559689
inspired by unreflectable_message of @oathdruid.

* Remove unnecessary MessageHelper
2024-10-30 19:49:19 +08:00
Dongsheng He 8d8a296f28 wrap the class name in single quotes (#2732)
Co-authored-by: Dongsheng He <hds@dipeak.com>
2024-10-11 10:01:22 +08:00
Xu Lei 64ce760fdf Support multiple RPCs parsing in wireshark dissector for baidu_std protocol (#2710)
Co-authored-by: xulei25 <xulei25@baidu.com>
2024-07-29 22:38:02 +08:00
Xiaofeng Wang 8b340f95a3 Get gcc version by script to support cross-compile (#2567)
Fix #1631
2024-03-22 11:13:09 +08:00
Dongsheng He b67aa06664 add lldb bthread stack debug script (#2514)
* add lldb bthread stack helper script

* fix value as unsigned
2024-01-23 12:11:55 +08:00
Dongsheng He 3680dbaf59 fix gdb bthread stack when using libc++ (#2516) 2024-01-22 15:42:36 +08:00
Didier Raboud f19ae4f253 Fix english typos (#2496)
* Fix ploting -> plotting typo
* Fix is not enable -> is not enabled typo
* Fix allowd -> allowed typo
* Fix paramters -> parameters typo
* Fix reponse -> response typo
* Fix seperated -> separated typo
2024-01-05 13:59:22 +08:00
Xiaofeng Wang 12d072862e Add wireshark dissector for baidu_std protocol (#2408) 2023-10-18 03:28:37 +08:00
AIxWall e5d81e91bd Update gdb_bthread_stack.py (#2217)
add "print all bthread frames" command
2023-04-26 11:25:53 +08:00
Xiaofeng Wang d6df0f156a Prefer to use env to find bash
Close #2070
2023-02-24 19:17:38 +08:00
Xiaofeng Wang 44332907de Install and pack brpc tools (#2096) 2023-01-20 10:08:08 +08:00
Jiashun Zhu 6faa88d2d4 Fix MacOS warning: bool literal returned from 'main' [-Wmain] (#2020) 2022-11-28 10:03:16 +08:00
果冻虾仁 581c7b1aaa remove unnecessary semicolon (#2004)
* example

* src,tool
2022-11-21 10:18:51 +08:00
ds 5a6d99a54c fix(rpc_replay) continue when failed to init channel (#1938)
* fix(rpc_replay) continue when failed to init channel

* check supported_connection_type

* check supported_connection_type

* check supported_connection_type

* fix lint
2022-10-08 15:11:18 +08:00
Shuai Zhang ad20082010 Chore: rework Bazel build system 2022-08-31 11:00:55 +08:00
bumingchun d0b71ffc34 fix rpc_replay can't send request equably (#1910)
* fix rpc_replay can't send request equably

* 类型修改
2022-08-29 10:27:22 +08:00
gejun 86beca89fe Fix override issue in pb 2022-08-26 21:07:11 +08:00
mwish 4a2e029ce8 Fixing compilation in rpc_press, and fixing typo in execution-queue (#1846) 2022-07-22 11:53:56 +08:00
LorinLee 28eb063606 Merge pull request #1783 from wwbmmm/fix-attribute-const
Fix __const__ compile error in gcc version >= 11.2.0
2022-07-15 21:53:26 +08:00
bumingchun c945795ce5 fix rpc_press can't send request equably (#1763)
* fix rpc_press can't send request equably

* set rate limit to 1000000 in one thread && calculate interval with nanosecond

* change sleep function to usleep

* Update rpc_press_impl.cpp

add the max tolerant delay between end_time and expected_time

Co-authored-by: bumingchun <bumingchun@192.168.1.8>
2022-06-20 13:49:26 +08:00
wangweibing 87e18c6a15 Fix __const__ compile error in gcc version >= 11.2.0 2022-06-07 14:51:21 +08:00
wangweibing 3323eb3350 Fix merge conflicts 2022-03-28 07:16:43 +00:00
wangweibing 15dc3b5887 Merge branch 'master' into nshead_rpc_dump_and_replay 2022-03-28 07:06:51 +00:00
guodongxiaren 600e3dcc27 merge master 2022-02-20 19:31:43 +08:00
guodongxiaren b585ec2064 Merge branch 'master' into dump_http 2022-02-20 18:49:22 +08:00
guodongxiaren a46692ac8b add http_host gflag for rpc_replay 2022-01-27 21:16:02 +08:00
Weibing Wang 37c27ab5cb Merge pull request #1651 from ehds/fix-rpc-view-defer-stop-second
Fix rpc view `defer_close_second flag` typo
2022-01-26 14:28:26 +08:00
taoxu 9d078e1c97 Add rpc_replay BUILD file 2022-01-19 14:49:41 +08:00
ehds a3cb1111ce fix: rpc_view defer_close_second flag typo 2021-12-21 22:38:03 +08:00
果冻虾仁 3b95a405e7 Dump http header (#4)
* dump header
2021-08-22 12:38:42 +08:00
v1siuol 2330de7fd8 Fix tools/get_brpc_revision.sh 2021-08-20 00:07:50 -04:00
jamesge 732f57bc09 Merge pull request #1520 from apache/tanzhongyi003-patch-2
Update get_brpc_revision.sh
2021-08-14 16:50:25 +08:00
tanzhongyi 0253a2881e Update gdb_bthread_stack.py
add license header for this script
2021-08-14 16:28:34 +08:00
tanzhongyi 2f04fdedb8 Update get_brpc_revision.sh
Add License header for this file
2021-08-14 16:24:03 +08:00
果冻虾仁 61f8a0ff0c Merge branch 'apache:master' into dump_http 2021-07-29 21:48:58 +08:00
wangweibing 406eaa0dcf Support nshead protocol dump and replay 2021-07-16 09:43:32 +00:00
LorinLee 8dc52a7b68 Merge pull request #1459 from serverglen/rpc_view
rpc_view support setting timeout
2021-07-05 11:30:05 +08:00
serverglen dd7faed025 rpc_view support setting timeout 2021-07-02 22:36:53 +08:00
guodongxiaren 9ce0402ba0 chan resize +1 2021-06-03 21:25:08 +08:00
guodongxiaren 0204c7dfed rpc replay 2021-06-02 23:35:13 +08:00
guodongxiaren 161bf69ea8 rpc_replay http 2021-06-01 21:41:43 +08:00
jamesge 74310245bf make by config_brpc.sh shows commands by default, add -s to hide 2020-02-10 17:03:22 +08:00
jamesge 9f510165bc fix warnings on MACOS 2020-01-21 16:25:30 +08:00