Bug #19368 Failure in "flush_instances" causes assert in Thread_registry
Submitted: 26 Apr 2006 10:04 Modified: 25 Oct 2006 18:57
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:Instance Manager Severity:S2 (Serious)
Version:5.0.21 OS:Any (all)
Assigned to: Petr Chardin CPU Architecture:Any

[26 Apr 2006 10:04] Magnus Blåudd
Description:
If instance manager fails to "flush_instances" it will return from the 'manager' function. When that happens Thread_registry destructor will be calledand a DBUG_ASSERT will check it does not contain any threads. At this time it will contain at least the guardian thread and it will thus cause the assert to be triggered.

manager.cc:201
  if (instance_map.flush_instances())
  {
    log_error("manager(): Cannot init instances repository. This might be"
              "caused by the wrong config file options. For instance, "
              "missing mysqld binary. Aborting.");
    return;
  }

How to repeat:
Give for example wrong mysqld_path when starting instance manager.

Suggested fix:
Shutdown all thread and unregister them from Thread_registry before returning from function.
[5 Oct 2006 18:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/13134

ChangeSet@1.2276, 2006-10-05 22:07:21+04:00, petr@mysql.com +2 -0
  Fix Bug #19368 Failure in "flush_instances" causes assert in Thread_registry
  
  Stop guardian and all the rest of threads before shutdown in case of an error
[25 Oct 2006 13:09] Petr Chardin
merged with 5.0.28, and 5.1.13 by Konstantin
[25 Oct 2006 18:57] Paul DuBois
Noted in 5.0.30, 5.1.13 changelogs.