@ -3796,15 +3796,21 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) {
RecordTick ( options_ . statistics . get ( ) , WRITE_DONE_BY_OTHER , 1 ) ;
RecordTick ( options_ . statistics . get ( ) , WRITE_DONE_BY_OTHER , 1 ) ;
return w . status ;
return w . status ;
} else if ( timed_out ) {
} else if ( timed_out ) {
# ifndef NDEBUG
bool found = false ;
bool found = false ;
# endif
for ( auto iter = writers_ . begin ( ) ; iter ! = writers_ . end ( ) ; iter + + ) {
for ( auto iter = writers_ . begin ( ) ; iter ! = writers_ . end ( ) ; iter + + ) {
if ( * iter = = & w ) {
if ( * iter = = & w ) {
writers_ . erase ( iter ) ;
writers_ . erase ( iter ) ;
# ifndef NDEBUG
found = true ;
found = true ;
# endif
break ;
break ;
}
}
}
}
# ifndef NDEBUG
assert ( found ) ;
assert ( found ) ;
# endif
// writers_.front() might still be in cond_wait without a time-out.
// writers_.front() might still be in cond_wait without a time-out.
// As a result, we need to signal it to wake it up. Otherwise no
// As a result, we need to signal it to wake it up. Otherwise no
// one else will wake him up, and RocksDB will hang.
// one else will wake him up, and RocksDB will hang.