MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:October 3 2006 2:43pm
Subject:bk commit into 5.0 tree (anozdrin:1.2274) BUG#15934
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of alik. When alik 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-10-03 18:42:59+04:00, anozdrin@alik. +4 -0
  Patch for BUG#15934: im_daemon_life_cycle fails sporadically.
  
  The problem was a race condition in a test case.
  
  The fix eliminates the race condition by explicit
  wait on UNIX socket to start accepting connections.
  
  The patch affects only test suite (i.e. does not touch
  server codebase).

  mysql-test/mysql-test-run.pl@stripped, 2006-10-03 18:42:58+04:00, anozdrin@alik. +6 -0
    Expose necessary environment variables.

  mysql-test/r/im_daemon_life_cycle.result@stripped, 2006-10-03 18:42:58+04:00, anozdrin@alik. +1 -0
    Update result file.

  mysql-test/t/im_daemon_life_cycle.imtest@stripped, 2006-10-03 18:42:58+04:00, anozdrin@alik. +6 -0
    Wait for Instance Manager to start accepting connections
    after restart.

  mysql-test/t/wait_for_socket.sh@stripped, 2006-10-03 18:42:58+04:00, anozdrin@alik. +62 -0
    Helper script: waits for UNIX socket to start accepting connections.

  mysql-test/t/wait_for_socket.sh@stripped, 2006-10-03 18:42:58+04:00, anozdrin@alik. +0 -0

# 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:	anozdrin
# Host:	alik.
# Root:	/mnt/raid/alik/MySQL/devel/5.0-rt-bug15934
--- New file ---
+++ mysql-test/t/wait_for_socket.sh	06/10/03 18:42:58
#!/bin/sh

###########################################################################

if [ $# -ne 6 ]; then
  echo "Usage: wait_for_socket.sh <executable path> <socket path> <username> <password> <db> <timeout>"
  exit 0
fi

client_exe="$1"
socket_path="$2"
username="$3"
password="$4"
db="$5"
total_timeout="$6"

###########################################################################

if [ -z "$client_exe" ]; then
  echo "Error: invalid path to client executable ($client_exe)."
  exit 0;
fi

if [ ! -x "$client_exe" ]; then
  echo "Error: client by path '$client_exe' is not available."
  exit 0;
fi

if [ -z "$socket_path" ]; then
  echo "Error: invalid socket patch."
  exit 0
fi

###########################################################################

client_args="--silent --socket=$socket_path "

[ -n "$username" ] && client_args="$client_args --user=$username "
[ -n "$password" ] && client_args="$client_args --password=$password "
[ -n "$db" ] && client_args="$client_args $db"

###########################################################################

cur_attempt=1

while true; do

  if ( echo 'quit' | "$client_exe" $client_args >/dev/null 2>&1 ); then
    echo "Success: server is ready to accept connection on socket."
    exit 0
  fi

  [ $cur_attempt -ge $total_timeout ] && break

  sleep 1

  cur_attempt=`expr $cur_attempt + 1`

done

echo "Error: server does not accept connections after $total_timeout seconds."
exit 0


--- 1.6/mysql-test/r/im_daemon_life_cycle.result	2006-10-03 18:43:04 +04:00
+++ 1.7/mysql-test/r/im_daemon_life_cycle.result	2006-10-03 18:43:04 +04:00
@@ -8,6 +8,7 @@ mysqld2	offline
 Killing the process...
 Sleeping...
 Success: the process was restarted.
+Success: server is ready to accept connection on socket.
 
 --------------------------------------------------------------------
 -- Test for BUG#12751

--- 1.5/mysql-test/t/im_daemon_life_cycle.imtest	2006-10-03 18:43:04 +04:00
+++ 1.6/mysql-test/t/im_daemon_life_cycle.imtest	2006-10-03 18:43:04 +04:00
@@ -17,6 +17,12 @@
 
 ###########################################################################
 
+# Wait for IM to start accepting connections.
+
+--exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 30
+
+###########################################################################
+
 #
 # BUG#12751: Instance Manager: client hangs
 #

--- 1.115/mysql-test/mysql-test-run.pl	2006-10-03 18:43:04 +04:00
+++ 1.116/mysql-test/mysql-test-run.pl	2006-10-03 18:43:04 +04:00
@@ -1249,6 +1249,9 @@ sub environment_setup () {
   $ENV{'IM_PATH_PID'}=        $instance_manager->{path_pid};
   $ENV{'IM_PATH_ANGEL_PID'}=  $instance_manager->{path_angel_pid};
   $ENV{'IM_PORT'}=            $instance_manager->{port};
+  $ENV{'IM_PATH_SOCK'}=       $instance_manager->{path_sock};
+  $ENV{'IM_USERNAME'}=        $instance_manager->{admin_login};
+  $ENV{'IM_PASSWORD'}=        $instance_manager->{admin_password};
 
   $ENV{'IM_MYSQLD1_SOCK'}=    $instance_manager->{instances}->[0]->{path_sock};
   $ENV{'IM_MYSQLD1_PORT'}=    $instance_manager->{instances}->[0]->{port};
@@ -1256,6 +1259,9 @@ sub environment_setup () {
   $ENV{'IM_MYSQLD2_SOCK'}=    $instance_manager->{instances}->[1]->{path_sock};
   $ENV{'IM_MYSQLD2_PORT'}=    $instance_manager->{instances}->[1]->{port};
   $ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid};
+
+  $ENV{'EXE_MYSQL'}=          $exe_mysql;
+
 
   $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
 
Thread
bk commit into 5.0 tree (anozdrin:1.2274) BUG#15934Alexander Nozdrin3 Oct