feat(auto_cl): add error rate threshold for punishment attenuation (#3219)

* feat(auto_cl): add error rate threshold for punishment attenuation

Add new GFlag `auto_cl_error_rate_punish_threshold` to enable
error-rate-based punishment attenuation in AutoConcurrencyLimiter.

Problem: Low error rates (e.g., 1.3% sporadic timeouts) cause
disproportionate avg_latency inflation (+31%), leading the limiter
to mistakenly shrink max_concurrency and trigger ELIMIT rejections.

Solution: Inspired by Alibaba Sentinel's threshold-based approach:
- threshold=0 (default): Original behavior preserved (backward compat)
- threshold>0 (e.g., 0.1): Error rates below threshold produce zero
  punishment; above it, punishment scales linearly from 0 to full

Example: With threshold=0.1, a 5% error rate produces no punishment,
while a 50% error rate produces 44% of the original punishment.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
4 files changed
tree: f1d780861e624314946874f3dde3c50f1b2d89aa
  1. .github/
  2. bazel/
  3. cmake/
  4. community/
  5. docs/
  6. example/
  7. homebrew-formula/
  8. java/
  9. package/
  10. python/
  11. src/
  12. test/
  13. tools/
  14. .asf.yaml
  15. .bazelignore
  16. .bazelrc
  17. .bazelversion
  18. .gitignore
  19. .licenserc.yaml
  20. BUILD.bazel
  21. CHANGES.md
  22. CMakeLists.txt
  23. CODE_OF_CONDUCT.md
  24. config.h.in
  25. config_brpc.sh
  26. CONTRIBUTING.md
  27. Dockerfile
  28. LICENSE
  29. Makefile
  30. MODULE.bazel
  31. NOTICE
  32. README.md
  33. README_cn.md
  34. RELEASE_VERSION
  35. WORKSPACE
  36. WORKSPACE.bzlmod
README.md

中文版

Linux Build Status MacOs Build Status

brpc logo (light) brpc logo (dark)

bRPC is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc.

“bRPC” means “better RPC”.

You can use it to:

Try it!

Contribute code

Please refer to here.

Feedback and Getting involved

Code of Conduct

We follow the code of conduct from Apache Software Foundation, please refer it here Link