Skip to content
Permalink
Browse files
MDEV-28995 Sporadic Assertion on shutdown in threadpool_winsockets.cc
Remove the affected assert.
Wait for all AIO_buffer_cache::release_buffer() to finish before
AIO_buffer_cache::clear().
  • Loading branch information
vaintroub committed Jul 1, 2022
1 parent 90792e4 commit ba3354f
Showing 1 changed file with 11 additions and 2 deletions.
@@ -114,8 +114,17 @@ void AIO_buffer_cache::clear()
if (!m_base)
return;

/* Check that all items are returned to the cache. */
DBUG_ASSERT(m_cache.size() == m_elements);
std::unique_lock<std::mutex> lk(m_mtx, std::defer_lock);
for(;;)
{
if (lk.try_lock())
{
if (m_cache.size() == m_elements)
break;
lk.unlock();
}
Sleep(100);
}
VirtualFree(m_base, 0, MEM_RELEASE);
m_cache.clear();
m_base= 0;

0 comments on commit ba3354f

Please sign in to comment.