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:
parent
ba10948e9d
commit
495b70ec6d
1 changed files with 9 additions and 13 deletions
22
ircd/db.cc
22
ircd/db.cc
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue