List:Commits« Previous MessageNext Message »
From:msvensson Date:September 22 2006 2:14pm
Subject:bk commit into 5.0 tree (msvensson:1.2286) BUG#22379
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-22 16:14:23+02:00, msvensson@neptunus.(none) +1 -0
  Bug#22379  im_daemon_life_cycle.test fails on merge of 5.1 -> 5.1-engines
   - Set state to STARTING before calling instance->start()
   - Check that pidfile has been created before changing STARTING => STARTED

  server-tools/instance-manager/guardian.cc@stripped, 2006-09-22 16:14:21+02:00, msvensson@neptunus.(none) +20 -6
    - If state of an instance is STARTING, chech kthat it's pidfile has been created before
    changing state to STARTED
    - Set state to STARTING before calling instance->start(), it can take some time before it is full started
    and during that time it should be in state STARTING

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug22379/my50-bug22379

--- 1.22/server-tools/instance-manager/guardian.cc	2006-09-22 16:14:28 +02:00
+++ 1.23/server-tools/instance-manager/guardian.cc	2006-09-22 16:14:28 +02:00
@@ -110,20 +110,34 @@
 
   if (instance->is_running())
   {
-    /* clear status fields */
-    current_node->restart_counter= 0;
-    current_node->crash_moment= 0;
-    current_node->state= STARTED;
+    /* The instance can be contacted  on it's port */
+
+    /* If STARTING also check that pidfile has been created */
+    if (current_node->state == STARTING &&
+        current_node->instance->options.get_pid() == 0)
+    {
+      /* Pid file not created yet, don't go to STARTED state yet  */
+    }
+    else
+    {
+      /* clear status fields */
+      log_info("guardian: instance %s is running, set state to STARTED",
+               instance->options.instance_name);
+      current_node->restart_counter= 0;
+      current_node->crash_moment= 0;
+      current_node->state= STARTED;
+    }
   }
   else
   {
     switch (current_node->state) {
     case NOT_STARTED:
-      instance->start();
-      current_node->last_checked= current_time;
       log_info("guardian: starting instance %s",
                instance->options.instance_name);
+      /* NOTE, set state to STARTING before start() is called */
       current_node->state= STARTING;
+      instance->start();
+      current_node->last_checked= current_time;
       break;
     case STARTED:     /* fallthrough */
     case STARTING:    /* let the instance start or crash */
Thread
bk commit into 5.0 tree (msvensson:1.2286) BUG#22379msvensson22 Sep