* Alexander Nozdrin <alik@stripped> [07/07/26 21:21]:
> ChangeSet@stripped, 2007-07-26 21:08:00+04:00, anozdrin@ibm. +4 -0
> 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.
Sigh. Could you at least limit the number of attempts?
OK to push.
> - instance->kill_mysqld(SIGTERM);
> + while (true)
> + {
> + if (!instance->kill_mysqld(SIGTERM))
> + break;
> +
> + if (!instance->is_active())
> + break;
> +
> + /* Sleep for 0.3 sec and check again. */
> +
> + my_sleep(300000);
> + }
>
--
-- Konstantin Osipov Software Developer, Moscow, Russia
-- MySQL AB, www.mysql.com The best DATABASE COMPANY in the GALAXY