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
This commit is contained in:
Yi Wu 2019-05-13 11:26:34 -07:00 committed by Facebook Github Bot
parent e626016545
commit 92c60547fe

View File

@ -2102,10 +2102,10 @@ class Benchmark {
cv_.SignalAll(); cv_.SignalAll();
} }
bool WaitForRecovery(uint64_t /*abs_time_us*/) { bool WaitForRecovery(uint64_t abs_time_us) {
InstrumentedMutexLock l(&mutex_); InstrumentedMutexLock l(&mutex_);
if (!recovery_complete_) { if (!recovery_complete_) {
cv_.Wait(/*abs_time_us*/); cv_.TimedWait(abs_time_us);
} }
if (recovery_complete_) { if (recovery_complete_) {
recovery_complete_ = false; recovery_complete_ = false;