MDEV-7429 main.mysqldump fails sporadically in buildbot
prevent concurrent cleanups in multi-threaded mysqlimport (they can happen if many threads get an error at the same time), safe_exit() is not thread-safe.
This commit is contained in:
parent
cd0813e33e
commit
121f3e4c90
@ -36,7 +36,7 @@
|
||||
|
||||
|
||||
/* Global Thread counter */
|
||||
uint counter;
|
||||
uint counter= 0;
|
||||
pthread_mutex_t counter_mutex;
|
||||
pthread_cond_t count_threshhold;
|
||||
|
||||
@ -489,6 +489,11 @@ static void safe_exit(int error, MYSQL *mysql)
|
||||
{
|
||||
if (error && ignore_errors)
|
||||
return;
|
||||
|
||||
/* in multi-threaded mode protect from concurrent safe_exit's */
|
||||
if (counter)
|
||||
pthread_mutex_lock(&counter_mutex);
|
||||
|
||||
if (mysql)
|
||||
mysql_close(mysql);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user