0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 23:44:01 +01:00

ircd::db: Improve shutdown sequence.

This commit is contained in:
Jason Volk 2018-12-16 18:34:52 -08:00
parent ba10948e9d
commit 495b70ec6d

View file

@ -1383,7 +1383,7 @@ ircd::db::database::~database()
noexcept try
{
const ctx::uninterruptible::nothrow ui;
const std::unique_lock<decltype(write_mutex)> lock{write_mutex};
log::info
{
log, "'%s': closing database @ `%s'...",
@ -1391,13 +1391,7 @@ noexcept try
path
};
rocksdb::CancelAllBackgroundWork(d.get(), true); // true = blocking
log::debug
{
log, "'%s': background_errors: %lu; flushing...",
name,
property<uint64_t>(*this, rocksdb::DB::Properties::kBackgroundErrors)
};
bgcancel(*this, true);
flush(*this);
log::debug
@ -1433,6 +1427,8 @@ noexcept try
d->Close()
};
env->st.reset(nullptr);
log::info
{
log, "'%s': closed database @ `%s' at sequence number %lu.",
@ -3480,11 +3476,6 @@ st{std::make_unique<state>(d)}
ircd::db::database::env::~env()
noexcept
{
log::debug
{
log, "'%s': Shutting down environment...",
d.name
};
}
rocksdb::Status
@ -7394,6 +7385,11 @@ ircd::db::database::env::state::state(database *const &d)
ircd::db::database::env::state::~state()
noexcept
{
log::debug
{
log, "'%s': Shutting down environment...",
d.name
};
}
//