From 92c60547fe1bc3254a18c2ff82e5398339cdb45b Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Mon, 13 May 2019 11:26:34 -0700 Subject: [PATCH] db_bench: fix hang on IO error (#5300) Summary: db_bench will wait indefinitely if there's background error. Fix by pass `abs_time_us` to cond var. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5300 Differential Revision: D15319945 Pulled By: miasantreble fbshipit-source-id: 0034fb7f6ec7c3303c4ccf26e54c20fbdac8ab44 --- tools/db_bench_tool.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index f0f1d879b..b2562f4e5 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -2102,10 +2102,10 @@ class Benchmark { cv_.SignalAll(); } - bool WaitForRecovery(uint64_t /*abs_time_us*/) { + bool WaitForRecovery(uint64_t abs_time_us) { InstrumentedMutexLock l(&mutex_); if (!recovery_complete_) { - cv_.Wait(/*abs_time_us*/); + cv_.TimedWait(abs_time_us); } if (recovery_complete_) { recovery_complete_ = false;