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

common: bench test fall into dead loop when <seconds>=0 #16382

Merged
merged 1 commit into from
Aug 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/common/obj_bencher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ int ObjBencher::write_bench(int secondsToRun,
stopTime = data.start_time + runtime;
slot = 0;
lock.Lock();
while (!secondsToRun || ceph_clock_now() < stopTime) {
while (secondsToRun && ceph_clock_now() < stopTime) {
bool found = false;
while (1) {
int old_slot = slot;
Expand Down Expand Up @@ -690,7 +690,7 @@ int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurre
bufferlist *cur_contents;

slot = 0;
while ((!seconds_to_run || ceph_clock_now() < finish_time) &&
while ((seconds_to_run && ceph_clock_now() < finish_time) &&
num_objects > data.started) {
lock.Lock();
int old_slot = slot;
Expand Down Expand Up @@ -920,7 +920,7 @@ int ObjBencher::rand_read_bench(int seconds_to_run, int num_objects, int concurr
int rand_id;

slot = 0;
while ((!seconds_to_run || ceph_clock_now() < finish_time)) {
while ((seconds_to_run && ceph_clock_now() < finish_time)) {
lock.Lock();
int old_slot = slot;
bool found = false;
Expand Down