Skip to content

OSS-Fuzz: Add new fuzzer targets concurrency operations - #3679

Open
arthurscchan wants to merge 2 commits into
apache:masterfrom
arthurscchan:brpc-concurrency-fuzzer
Open

arthurscchan wants to merge 2 commits into
apache:masterfrom
arthurscchan:brpc-concurrency-fuzzer

Conversation

@arthurscchan

Copy link
Copy Markdown
Contributor

This PR adds a new OSS-Fuzz fuzzer targets concurrency operations, aiming to improve the overall fuzzing coverage and effectiveness of project brpc.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Real-time sampling and reset deadlines prevent fast fuzz inputs from reliably exercising the intended limiter transitions.

1 open issue
What changed in this PR

This PR expands bRPC’s OSS-Fuzz coverage with a target for the automatic concurrency limiter.

Changes:

  • Adds fuzz-driven response errors, latencies, and request concurrency values.
  • Registers fuzz_concurrency in the CMake and OSS-Fuzz build lists.
File Description
test/​fuzzing/​oss-fuzz.sh Includes the new target in OSS-Fuzz builds.
test/​fuzzing/​fuzz_concurrency.cpp Adds the automatic concurrency limiter fuzz harness.
test/​CMakeLists.txt Registers the new CMake fuzz target.

Review effort: Balanced

Comment thread test/fuzzing/fuzz_concurrency.cpp Resolved
@arthurscchan
arthurscchan force-pushed the brpc-concurrency-fuzzer branch from c4696bf to f9e8d05 Compare November 10, 2026 10:28
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
@arthurscchan
arthurscchan force-pushed the brpc-concurrency-fuzzer branch from f9e8d05 to 0465080 Compare November 12, 2026 08:16
@wwbmmm
wwbmmm requested a balanced review from Copilot November 12, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

5 open issues
1 resolved since last review

Review effort: Lite

Comment thread test/fuzzing/fuzz_concurrency.cpp Resolved
Comment thread test/fuzzing/fuzz_concurrency.cpp Resolved
Comment thread test/fuzzing/fuzz_concurrency.cpp Resolved
Comment thread test/fuzzing/fuzz_concurrency.cpp Resolved
Comment thread test/fuzzing/fuzz_concurrency.cpp Resolved
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
@arthurscchan
arthurscchan force-pushed the brpc-concurrency-fuzzer branch from 0465080 to 1d2b7ec Compare November 12, 2026 10:08
@wwbmmm
wwbmmm requested a balanced review from Copilot November 12, 2026 11:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//
// Each 8-byte record is big-endian and decoded as:
// bits 0..7 error_code
// bits 8..15 request-tick flag (bit 8 / 0x100)
}

brpc::policy::AutoConcurrencyLimiter limiter;
int64_t now_us = butil::cpuwide_time_us();
static_cast<int64_t>((v >> kLatencyShift) & kLatencyMask);
limiter.AddSample(error_code, latency_us, now_us);
limiter.MaxConcurrency();
if ((v & (1ULL << kRequestFlagBit)) || (i & 7) == 0) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants