Commit 976f31c5 authored by unknown's avatar unknown

Fix for BUG#18023: IM: instance can be started several times;

monitor interval must be > 2sec.


server-tools/instance-manager/guardian.cc:
  Start instance only if it is really crashed.
parent 9b7258e1
...@@ -138,11 +138,14 @@ void Guardian_thread::process_instance(Instance *instance, ...@@ -138,11 +138,14 @@ void Guardian_thread::process_instance(Instance *instance,
break; break;
case JUST_CRASHED: case JUST_CRASHED:
if (current_time - current_node->crash_moment <= 2) if (current_time - current_node->crash_moment <= 2)
{
if (instance->is_crashed())
{ {
instance->start(); instance->start();
log_info("guardian: starting instance %s", log_info("guardian: starting instance %s",
instance->options.instance_name); instance->options.instance_name);
} }
}
else else
current_node->state= CRASHED; current_node->state= CRASHED;
break; break;
...@@ -151,6 +154,8 @@ void Guardian_thread::process_instance(Instance *instance, ...@@ -151,6 +154,8 @@ void Guardian_thread::process_instance(Instance *instance,
monitoring_interval) monitoring_interval)
{ {
if ((current_node->restart_counter < restart_retry)) if ((current_node->restart_counter < restart_retry))
{
if (instance->is_crashed())
{ {
instance->start(); instance->start();
current_node->last_checked= current_time; current_node->last_checked= current_time;
...@@ -158,6 +163,7 @@ void Guardian_thread::process_instance(Instance *instance, ...@@ -158,6 +163,7 @@ void Guardian_thread::process_instance(Instance *instance,
log_info("guardian: restarting instance %s", log_info("guardian: restarting instance %s",
instance->options.instance_name); instance->options.instance_name);
} }
}
else else
current_node->state= CRASHED_AND_ABANDONED; current_node->state= CRASHED_AND_ABANDONED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment