Commit e28b2c5a authored by Brandon Nesterenko's avatar Brandon Nesterenko

Restore thread existence check

parent 9a215d63
...@@ -2673,6 +2673,8 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr, ...@@ -2673,6 +2673,8 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr,
Relay_log_info *rli= rgi->rli; Relay_log_info *rli= rgi->rli;
rpl_parallel_thread *thr= cur_thr->thr; rpl_parallel_thread *thr= cur_thr->thr;
if (thr)
{
*did_enter_cond= false; *did_enter_cond= false;
mysql_mutex_lock(&thr->LOCK_rpl_thread); mysql_mutex_lock(&thr->LOCK_rpl_thread);
for (;;) for (;;)
...@@ -2709,17 +2711,16 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr, ...@@ -2709,17 +2711,16 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr,
and this can cause THD::awake to use the wrong mutex. and this can cause THD::awake to use the wrong mutex.
*/ */
#ifdef ENABLED_DEBUG_SYNC #ifdef ENABLED_DEBUG_SYNC
DBUG_EXECUTE_IF("rpl_parallel_wait_queue_max", DBUG_EXECUTE_IF("rpl_parallel_wait_queue_max", {
{ debug_sync_set_action(
debug_sync_set_action(rli->sql_driver_thd, rli->sql_driver_thd,
STRING_WITH_LEN("now SIGNAL wait_queue_ready")); STRING_WITH_LEN("now SIGNAL wait_queue_ready"));
};); };);
#endif #endif
rli->sql_driver_thd->set_time_for_next_stage(); rli->sql_driver_thd->set_time_for_next_stage();
rli->sql_driver_thd->ENTER_COND(&thr->COND_rpl_thread_queue, rli->sql_driver_thd->ENTER_COND(
&thr->LOCK_rpl_thread, &thr->COND_rpl_thread_queue, &thr->LOCK_rpl_thread,
&stage_waiting_for_room_in_worker_thread, &stage_waiting_for_room_in_worker_thread, old_stage);
old_stage);
*did_enter_cond= true; *did_enter_cond= true;
} }
...@@ -2729,9 +2730,9 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr, ...@@ -2729,9 +2730,9 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr,
did_enter_cond, old_stage); did_enter_cond, old_stage);
my_error(ER_CONNECTION_KILLED, MYF(0)); my_error(ER_CONNECTION_KILLED, MYF(0));
#ifdef ENABLED_DEBUG_SYNC #ifdef ENABLED_DEBUG_SYNC
DBUG_EXECUTE_IF("rpl_parallel_wait_queue_max", DBUG_EXECUTE_IF("rpl_parallel_wait_queue_max", {
{ debug_sync_set_action(
debug_sync_set_action(rli->sql_driver_thd, rli->sql_driver_thd,
STRING_WITH_LEN("now SIGNAL wait_queue_killed")); STRING_WITH_LEN("now SIGNAL wait_queue_killed"));
};); };);
#endif #endif
...@@ -2742,6 +2743,7 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr, ...@@ -2742,6 +2743,7 @@ rpl_parallel_entry::choose_thread_internal(sched_bucket *cur_thr,
mysql_cond_wait(&thr->COND_rpl_thread_queue, &thr->LOCK_rpl_thread); mysql_cond_wait(&thr->COND_rpl_thread_queue, &thr->LOCK_rpl_thread);
} }
} }
}
if (!thr) if (!thr)
cur_thr->thr= thr= cur_thr->thr= thr=
......
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