diff options
author | Kentoku SHIBA <kentokushiba@gmail.com> | 2020-06-25 01:15:35 +0900 |
---|---|---|
committer | Kentoku SHIBA <kentokushiba@gmail.com> | 2020-06-25 13:29:48 +0900 |
commit | 6df1b7b4f794eecb675abfa0737748b857401062 (patch) | |
tree | b54712fe7f6cdf16ef0ab1a7bf587dd309a1a800 | |
parent | e1013725ce0f3f947e728491eef75d9985e8db2f (diff) | |
download | mariadb-git-bb-10.5-backport-ks.tar.gz |
MDEV-22979 "mysqld --bootstrap" / mysql_install_db hangs when Spider is installedbb-10.5-backport-ks
-rw-r--r-- | storage/spider/spd_table.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 583bfebbed6..f4b0177c794 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -10324,13 +10324,22 @@ void *spider_table_bg_sts_action( thd->mysys_var->current_mutex = spd_LOCK_server_started; if (!(*spd_mysqld_server_started) && !thd->killed) { - pthread_cond_wait(spd_COND_server_started, spd_LOCK_server_started); + do + { + struct timespec abstime; + set_timespec_nsec(abstime, 1000); + error_num = pthread_cond_timedwait(spd_COND_server_started, + spd_LOCK_server_started, &abstime); + } while ( + (error_num == ETIMEDOUT || error_num == ETIME) && + !(*spd_mysqld_server_started) && !thd->killed && !thread->killed + ); } pthread_mutex_unlock(spd_LOCK_server_started); thd->mysys_var->current_cond = &thread->cond; thd->mysys_var->current_mutex = &thread->mutex; } - while (spider_init_queries[i].length && !thd->killed) + while (spider_init_queries[i].length && !thd->killed && !thread->killed) { dispatch_command(COM_QUERY, thd, spider_init_queries[i].str, (uint) spider_init_queries[i].length, FALSE, FALSE); |