summaryrefslogtreecommitdiff
path: root/server-tools/instance-manager/instance.cc
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@ibm.>2007-07-27 17:39:01 +0400
committerunknown <anozdrin/alik@ibm.>2007-07-27 17:39:01 +0400
commit339ea316b938b9b1c2a166c6580bf84333d80a5f (patch)
tree0a1027664b33f7702e2d5be5c3cad1a9cc9af9a4 /server-tools/instance-manager/instance.cc
parent1336b0eb1371868c3e6596565cbe35978dfa6140 (diff)
downloadmariadb-git-339ea316b938b9b1c2a166c6580bf84333d80a5f.tar.gz
Fix for BUG#28030: test im_instance_conf fails with an assert.
The problem was a race condition on shutdown -- when IM got shutdown request while a guarded mysqld is starting. In this case the Guardian thread tried to stop the mysqld, but might fail if the mysqld hadn't created pid-file so far. When this happened, the mysqld-monitor thread didn't stop, so the assert in Thread_registry happened. The fix is to make several attempts to stop mysqld if it is active. server-tools/instance-manager/guardian.cc: Try to stop mysqld several times if it is still active. server-tools/instance-manager/instance.cc: Make Instance::kill_mysqld() to return operation status. server-tools/instance-manager/instance.h: Make Instance::kill_mysqld() to return operation status. server-tools/instance-manager/thread_registry.cc: Log unregistered thread ids.
Diffstat (limited to 'server-tools/instance-manager/instance.cc')
-rw-r--r--server-tools/instance-manager/instance.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc
index 80e7e99214b..4a1b658737e 100644
--- a/server-tools/instance-manager/instance.cc
+++ b/server-tools/instance-manager/instance.cc
@@ -771,7 +771,7 @@ bool Instance::stop_mysqld()
These operations should also be used in Guardian to manage instances.
*/
-void Instance::kill_mysqld(int signum)
+bool Instance::kill_mysqld(int signum)
{
pid_t mysqld_pid= options.load_pid();
@@ -780,7 +780,7 @@ void Instance::kill_mysqld(int signum)
log_info("Instance '%s': no pid file to send a signal (%d).",
(const char *) get_name()->str,
(int) signum);
- return;
+ return TRUE;
}
log_info("Instance '%s': sending %d to %d...",
@@ -792,7 +792,7 @@ void Instance::kill_mysqld(int signum)
{
log_info("Instance '%s': kill() failed.",
(const char *) get_name()->str);
- return;
+ return TRUE;
}
/* Kill suceeded */
@@ -804,6 +804,8 @@ void Instance::kill_mysqld(int signum)
/* After sucessful hard kill the pidfile need to be removed */
options.unlink_pidfile();
}
+
+ return FALSE;
}