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
...@@ -139,9 +139,12 @@ void Guardian_thread::process_instance(Instance *instance, ...@@ -139,9 +139,12 @@ void Guardian_thread::process_instance(Instance *instance,
case JUST_CRASHED: case JUST_CRASHED:
if (current_time - current_node->crash_moment <= 2) if (current_time - current_node->crash_moment <= 2)
{ {
instance->start(); if (instance->is_crashed())
log_info("guardian: starting instance %s", {
instance->options.instance_name); instance->start();
log_info("guardian: starting instance %s",
instance->options.instance_name);
}
} }
else else
current_node->state= CRASHED; current_node->state= CRASHED;
...@@ -152,11 +155,14 @@ void Guardian_thread::process_instance(Instance *instance, ...@@ -152,11 +155,14 @@ void Guardian_thread::process_instance(Instance *instance,
{ {
if ((current_node->restart_counter < restart_retry)) if ((current_node->restart_counter < restart_retry))
{ {
instance->start(); if (instance->is_crashed())
current_node->last_checked= current_time; {
current_node->restart_counter++; instance->start();
log_info("guardian: restarting instance %s", current_node->last_checked= current_time;
instance->options.instance_name); current_node->restart_counter++;
log_info("guardian: restarting instance %s",
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