From 57ed24f8688048b20ccee7eacf98e147bc41dc86 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 5 Feb 2018 18:52:31 -0800 Subject: [PATCH] ircd::db: Reenable the background work cancel for shutdown sequence. --- ircd/db.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ircd/db.cc b/ircd/db.cc index 83dbc8183..b9a2ada2b 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -395,22 +395,19 @@ catch(const std::exception &e) ircd::db::database::~database() noexcept { - //rocksdb::CancelAllBackgroundWork(d, true); // true = blocking - //throw_on_error(d->PauseBackgroundWork()); - const auto background_errors - { - property(*this, rocksdb::DB::Properties::kBackgroundErrors) - }; - - log.debug("'%s': closing database @ `%s' (background errors: %lu)", + rocksdb::CancelAllBackgroundWork(d.get(), true); // true = blocking + log.debug("'%s': closing database @ `%s'; background_errors: %lu", name, path, - background_errors); + property(*this, rocksdb::DB::Properties::kBackgroundErrors)); + + this->columns.clear(); + log.debug("'%s': flushed columns; synchronizing...", + name); sync(*this); - this->columns.clear(); - log.debug("'%s': closed columns; synchronized with hardware.", - this->name); + log.debug("'%s': synchronized with hardware.", + name); } void