0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-26 05:48:20 +02:00

ircd::db: Cancel all prefetches on database shutdown.

This commit is contained in:
Jason Volk 2019-09-08 13:34:49 -07:00
parent 0422f29a66
commit 27a1997ab1

View file

@ -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