Skip to content

Commit

Permalink
Merge pull request ceph#26918 from trociny/wip-rbd-bench-wait-on-inte…
Browse files Browse the repository at this point in the history
…rrupted

rbd: wait for all io complete when bench is interrupted

Reviewed-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman authored Mar 14, 2019
2 parents 7831b98 + 95b6a76 commit bf53d69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tools/rbd/action/Bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ struct rbd_bencher {
}
}

int wait_for(int max) {
int wait_for(int max, bool interrupt_on_terminating) {
Mutex::Locker l(lock);
while (in_flight > max && !terminating) {
while (in_flight > max && !(terminating && interrupt_on_terminating)) {
utime_t dur;
dur.set_from_double(.2);
cond.WaitInterval(lock, dur);
Expand Down Expand Up @@ -292,7 +292,7 @@ int do_bench(librbd::Image& image, io_type_t io_type,
while (i < io_threads && off < io_bytes) {
bool read_flag = should_read(read_proportion);

r = b.wait_for(io_threads - 1);
r = b.wait_for(io_threads - 1, true);
if (r < 0) {
break;
}
Expand Down Expand Up @@ -351,7 +351,7 @@ int do_bench(librbd::Image& image, io_type_t io_type,
last = elapsed;
}
}
b.wait_for(0);
b.wait_for(0, false);

if (io_type != IO_TYPE_READ) {
r = image.flush();
Expand Down

0 comments on commit bf53d69

Please sign in to comment.