Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix arbitration fuzzer failure #12005

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions velox/exec/fuzzer/MemoryArbitrationFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,10 @@ void MemoryArbitrationFuzzer::verify() {
}

// Inject global arbitration.
auto shrinkRng = FuzzerGenerator(rng_());
std::thread globalShrinkThread([&]() {
while (!stop) {
if (getRandomIndex(rng_, 99) < FLAGS_global_arbitration_pct) {
if (getRandomIndex(shrinkRng, 99) < FLAGS_global_arbitration_pct) {
memory::memoryManager()->shrinkPools();
}
std::this_thread::sleep_for(std::chrono::seconds(1));
Expand All @@ -851,6 +852,7 @@ void MemoryArbitrationFuzzer::verify() {

// Create a thread that randomly abort one worker thread
// every task_abort_interval_ms milliseconds.
auto abortRng = FuzzerGenerator(rng_());
std::thread abortControlThread([&]() {
if (FLAGS_task_abort_interval_ms == 0) {
return;
Expand All @@ -860,7 +862,7 @@ void MemoryArbitrationFuzzer::verify() {
std::this_thread::sleep_for(
std::chrono::milliseconds(FLAGS_task_abort_interval_ms));
auto tasksList = Task::getRunningTasks();
auto index = getRandomIndex(rng_, tasksList.size() - 1);
vector_size_t index = getRandomIndex(abortRng, tasksList.size() - 1);
++taskAbortRequestCount;
tasksList[index]->requestAbort();
} catch (const VeloxException& e) {
Expand Down
Loading