BUG#23312 - server hangs 'closing tables' with insert delayed,flush

            tables,alter table
Deadlock could happen if there are delayed insert + flush tables + alter table
running concurrently.

This is fixed by removing a redundant mutex lock when killing a delayed thread.
parent d2fa9fd1
...@@ -1181,8 +1181,6 @@ void kill_delayed_threads(void) ...@@ -1181,8 +1181,6 @@ void kill_delayed_threads(void)
delayed_insert *tmp; delayed_insert *tmp;
while ((tmp=it++)) while ((tmp=it++))
{ {
/* Ensure that the thread doesn't kill itself while we are looking at it */
pthread_mutex_lock(&tmp->mutex);
tmp->thd.killed=1; tmp->thd.killed=1;
if (tmp->thd.mysys_var) if (tmp->thd.mysys_var)
{ {
...@@ -1201,7 +1199,6 @@ void kill_delayed_threads(void) ...@@ -1201,7 +1199,6 @@ void kill_delayed_threads(void)
} }
pthread_mutex_unlock(&tmp->thd.mysys_var->mutex); pthread_mutex_unlock(&tmp->thd.mysys_var->mutex);
} }
pthread_mutex_unlock(&tmp->mutex);
} }
VOID(pthread_mutex_unlock(&LOCK_delayed_insert)); // For unlink from list VOID(pthread_mutex_unlock(&LOCK_delayed_insert)); // For unlink from list
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment