Skip to content

[Corpus] Use threads for datastore operations under targets feature flag - #5352

Merged
PauloVLB merged 1 commit into
masterfrom
feature-flag-fuzz-target
Jul 7, 2026
Merged

[Corpus] Use threads for datastore operations under targets feature flag#5352
PauloVLB merged 1 commit into
masterfrom
feature-flag-fuzz-target

Conversation

@PauloVLB

@PauloVLB PauloVLB commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

b/530149063

Possible Problem

corpus_pruning tasks are failing silently with OOM because of how we do GCS operations (uploads, deletions). We are using a process pool with 16 workers, which calls fork(). If the parent process memory is large, doing this multiplies the memory and kills the bot instantly.

Proposed Solution

Switch from processes to threads for these I/O bound GCS operations in storage.py. Threads share memory, avoiding the fork() memory multiplication.
To roll this out safely, it is guarded by the STORAGE_THREADED_OPS_FUZZ_TARGETS feature flag.

Feature Flag Setup

image

Testing

We are going to test this with the iperf project, which is a known project where we can test on. Specifically, we will add libFuzzer_iperf_cjson_fuzz to the feature flag allowlist.

Validation

I validated this in the dev environment and verified that the code path is triggered correctly and works as expected.

image

@PauloVLB
PauloVLB force-pushed the feature-flag-fuzz-target branch from ace267d to 006083d Compare July 7, 2026 14:19
@PauloVLB
PauloVLB marked this pull request as ready for review July 7, 2026 14:42
@PauloVLB
PauloVLB requested a review from a team as a code owner July 7, 2026 14:42

@javanlacerda javanlacerda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Thanks for catching and fixing this. Nice job!

@PauloVLB
PauloVLB merged commit 5f043db into master Jul 7, 2026
15 checks passed
@PauloVLB
PauloVLB deleted the feature-flag-fuzz-target branch July 7, 2026 17:09
Comment thread src/clusterfuzz/_internal/base/concurrency.py
@PauloVLB PauloVLB changed the title Use threads for datastore operations under targets feature flag [Corpus] Use threads for datastore operations under targets feature flag Aug 7, 2026
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.

3 participants