rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

deadlock caused by calling SetOptions() in OnStallConditionsChanged()

Open zergvszerg opened this issue 1 year ago • 0 comments

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

Exepct to see explicit comment on EventListener::OnStallConditionsChanged() callback mentioning SetOptions() cannot be used to avoid deadlock.

Actual behavior

Observed deadlock caused by calling WriteOptions() in OnStallConditionsChanged(). BackgroundCallFlush() => SuperVersionContext::Clean() => OnStallConditionsChanged() => WriteOptionsFile() => WriteThread::EnterUnbatched() => WriteThread::LinkOne() => wait for stall WriteImpl() => PreprocessWrite() => DelayWrite() => wait for stall

Steps to reproduce the behavior

  • Override EventListener::OnStallConditionsChanged() to call DB::SetOptions().
  • Create a write stall.

zergvszerg avatar Mar 15 '24 06:03 zergvszerg