mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd::db: Cancel all prefetches on database shutdown.
This commit is contained in:
parent
0422f29a66
commit
27a1997ab1
1 changed files with 20 additions and 0 deletions
20
ircd/db.cc
20
ircd/db.cc
|
@ -1467,6 +1467,26 @@ noexcept try
|
|||
path
|
||||
};
|
||||
|
||||
if(likely(prefetcher))
|
||||
{
|
||||
const size_t canceled
|
||||
{
|
||||
prefetcher->cancel(*this)
|
||||
};
|
||||
|
||||
log::debug
|
||||
{
|
||||
log, "[%s] canceled %zu queued prefetches; waiting for any pending ...",
|
||||
name,
|
||||
canceled,
|
||||
};
|
||||
|
||||
// prefetcher::cancel() only removes requests from its queue, but if
|
||||
// a prefetch request from this database is in flight that is bad; so
|
||||
// we wait until the unit has completed its pending requests.
|
||||
prefetcher->wait_pending();
|
||||
}
|
||||
|
||||
bgcancel(*this, true);
|
||||
|
||||
log::debug
|
||||
|
|
Loading…
Reference in a new issue