diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-05-16 12:41:11 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-05-16 12:41:11 +0200 |
commit | d795bc9ff8d4a4e17f249a0eb9ac01f25d53a259 (patch) | |
tree | 34cb2909f877f529da8d539b32af9797189d62de /sql | |
parent | 9fae9930244d505585d83590051a17df9bab7d8a (diff) | |
download | mariadb-git-d795bc9ff8d4a4e17f249a0eb9ac01f25d53a259.tar.gz |
Fix race condition in binlog dump thread during server shutdown.
There was missing a check for THD::killed after THD::enter_cond(). This could
cause the binlog dump thread to miss the kill signal during server shutdown
and hang until it was force-closed.
Also fix a race in a test case that occasionally fails in Buildbot.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_repl.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index aa21d191166..2e10af0aa8c 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -2263,6 +2263,8 @@ impossible position"; thd->enter_cond(log_cond, log_lock, "Master has sent all binlog to slave; " "waiting for binlog to be updated"); + if (thd->killed) + break; ret= mysql_bin_log.wait_for_update_bin_log(thd, heartbeat_ts); DBUG_ASSERT(ret == 0 || (heartbeat_period != 0)); if (ret == ETIMEDOUT || ret == ETIME) @@ -2294,7 +2296,7 @@ impossible position"; { DBUG_PRINT("wait",("binary log received update or a broadcast signal caught")); } - } while (signal_cnt == mysql_bin_log.signal_cnt && !thd->killed); + } while (signal_cnt == mysql_bin_log.signal_cnt); thd->exit_cond(old_msg); } break; |