Skip to content
Permalink
Browse files

MDEV-20179 Server hangs on shutdown during installation of Spider (#1366

)
  • Loading branch information...
Kentoku committed Jul 29, 2019
1 parent 67177cd commit 83d368a062f017bd28536639cb2041a6f2b88d55
Showing with 13 additions and 6 deletions.
  1. +13 −6 storage/spider/spd_table.cc
@@ -10027,7 +10027,7 @@ void *spider_table_bg_sts_action(
tmp_disable_binlog(thd);
thd->security_ctx->skip_grants();
thd->client_capabilities |= CLIENT_MULTI_RESULTS;
while (spider_init_queries[i + 2].length)
while (spider_init_queries[i + 2].length && !thd->killed)
{
dispatch_command(COM_QUERY, thd, spider_init_queries[i].str,
(uint) spider_init_queries[i].length, FALSE, FALSE);
@@ -10041,18 +10041,21 @@ void *spider_table_bg_sts_action(
}
DBUG_PRINT("info",("spider first_free_wait=%s",
thread->first_free_wait ? "TRUE" : "FALSE"));
if (!thread->first_free_wait)
if (!thread->first_free_wait && !thd->killed)
{
thread->thd_wait = TRUE;
pthread_cond_wait(&thread->cond, &thread->mutex);
thread->thd_wait = FALSE;
}
DBUG_ASSERT(thread->first_free_wait);
pthread_cond_signal(&thread->sync_cond);
thread->thd_wait = TRUE;
pthread_cond_wait(&thread->cond, &thread->mutex);
thread->thd_wait = FALSE;
while (spider_init_queries[i].length)
if (!thd->killed)
{
thread->thd_wait = TRUE;
pthread_cond_wait(&thread->cond, &thread->mutex);
thread->thd_wait = FALSE;
}
while (spider_init_queries[i].length && !thd->killed)
{
dispatch_command(COM_QUERY, thd, spider_init_queries[i].str,
(uint) spider_init_queries[i].length, FALSE, FALSE);
@@ -10068,6 +10071,10 @@ void *spider_table_bg_sts_action(
reenable_binlog(thd);
thread->init_command = FALSE;
}
if (thd->killed)
{
thread->killed = TRUE;
}

while (TRUE)
{

0 comments on commit 83d368a

Please sign in to comment.
You can’t perform that action at this time.