Skip to content

Commit

Permalink
Fix for unchecked status in CancelAllBackgroundWork (facebook#11699)
Browse files Browse the repository at this point in the history
Summary:
## Summary
PR facebook#11497 introduced this. Status from `CancelPeriodicTaskScheduler()` is unchecked and causing test failure like https://app.circleci.com/pipelines/github/facebook/rocksdb/30743/workflows/24443a9b-6fc3-41e6-86c1-992d766eb1ec/jobs/642419

Pull Request resolved: facebook#11699

Test Plan: Existing tests

Reviewed By: cbi42

Differential Revision: D48287188

Pulled By: jaykorean

fbshipit-source-id: b6bcf6e3c3c47f126c34c24a3dfed2649635cc8c
  • Loading branch information
jaykorean authored and facebook-github-bot committed Aug 12, 2023
1 parent ef6f025 commit 793a786
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions db/db_impl/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,14 @@ void DBImpl::WaitForBackgroundWork() {
void DBImpl::CancelAllBackgroundWork(bool wait) {
ROCKS_LOG_INFO(immutable_db_options_.info_log,
"Shutdown: canceling all background work");
CancelPeriodicTaskScheduler();
Status s = CancelPeriodicTaskScheduler();
s.PermitUncheckedError();

InstrumentedMutexLock l(&mutex_);
if (!shutting_down_.load(std::memory_order_acquire) &&
has_unpersisted_data_.load(std::memory_order_relaxed) &&
!mutable_db_options_.avoid_flush_during_shutdown) {
Status s =
DBImpl::FlushAllColumnFamilies(FlushOptions(), FlushReason::kShutDown);
s = DBImpl::FlushAllColumnFamilies(FlushOptions(), FlushReason::kShutDown);
s.PermitUncheckedError(); //**TODO: What to do on error?
}

Expand Down

0 comments on commit 793a786

Please sign in to comment.