![](https://secure.gravatar.com/avatar/99fde0c1dfd216326aae0aff30d493f1.jpg?s=120&d=mm&r=g)
Monty,
My latest push uncovered a problem in the 10.2 tree; however the problem was
there before, just not triggered by the testsuite. I pushed the below patch
to fix the test failures in Buildbot, but I am not sure it is the correct
solution, so please check it.
It appears the problem was introduced with this patch:
commit 3d4a7390c1a94ef6e07b04b52ea94a95878cda1b
Author: Monty
revision-id: 49b25020ef512866751f192b91d8439670d0430b (mariadb-10.1.8-257-g49b2502) parent(s): be2b833c426b420073c50564125049e2b4a95e8b committer: Kristian Nielsen timestamp: 2016-09-09 18:09:59 +0200 message:
Fix assertion/hang in read_init_file()
If there are other threads running (for example binlog background thread), then the thread count may not drop to zero at the end of do_handle_bootstrap(). This caused an assertion and missing wakeup of the main thread. The missing wakeup is because THD::~THD() only signals the COND_thread_count mutex when the number of threads drops to zero.
Signed-off-by: Kristian Nielsen
--- sql/sql_parse.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7263082..6baff31 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1082,9 +1082,20 @@ void do_handle_bootstrap(THD *thd) end: in_bootstrap= FALSE; delete thd; + if (!opt_bootstrap) + { + /* + We need to wake up main thread in case of read_init_file(). + This is not done by THD::~THD() when there are other threads running + (binlog background thread, for example). So do it here again. + */ + mysql_mutex_lock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); + }
#ifndef EMBEDDED_LIBRARY - DBUG_ASSERT(thread_count == 0); + DBUG_ASSERT(!opt_bootstrap || thread_count == 0); my_thread_end(); pthread_exit(0); #endif _______________________________________________ commits mailing list commits@mariadb.org https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits