From: Date: August 31 2006 10:28am Subject: bk commit into 5.1 tree (msvensson:1.2296) BUG#21721 List-Archive: http://lists.mysql.com/commits/11145 X-Bug: 21721 Message-Id: <20060831082854.2DDB8860084@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.1 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-08-31 10:28:48+02:00, msvensson@shellback.(none) +1 -0 Bug#21721 Test suite does not start with NDB, hangs forever; problem around "ndb_mgmd" - Wait for ndb_mgmd with timeout mysql-test/mysql-test-run.pl@stripped, 2006-08-31 10:28:45+02:00, msvensson@shellback.(none) +20 -4 Add new function 'ndb_mgmd_wait_started' that will wait with timeout until ndb_mgmd has been started Don't bother to save the return value from 'ndb_mgmd_start' in local var as it's not used. # 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: shellback.(none) # Root: /home/msvensson/mysql/mysql-5.1-new-maint --- 1.158/mysql-test/mysql-test-run.pl 2006-08-31 10:28:54 +02:00 +++ 1.159/mysql-test/mysql-test-run.pl 2006-08-31 10:28:54 +02:00 @@ -1955,6 +1955,23 @@ } +sub ndb_mgmd_wait_started($) { + my ($cluster)= @_; + + my $retries= 100; + while (ndbcluster_wait_started($cluster, "--no-contact") and + $retries) + { + # Millisceond sleep emulated with select + select(undef, undef, undef, (0.1)); + + $retries--; + } + + return $retries == 0; + +} + sub ndb_mgmd_start ($) { my $cluster= shift; @@ -1975,13 +1992,12 @@ "", { append_log_file => 1 }); - # FIXME Should not be needed # Unfortunately the cluster nodes will fail to start # if ndb_mgmd has not started properly - while (ndbcluster_wait_started($cluster, "--no-contact")) + if (ndb_mgmd_wait_started($cluster)) { - select(undef, undef, undef, 0.1); + mtr_error("Failed to wait for start of ndb_mgmd"); } # Remember pid of ndb_mgmd @@ -2046,7 +2062,7 @@ mtr_error("Cluster '$cluster->{'name'}' already started"); } - my $pid= ndb_mgmd_start($cluster); + ndb_mgmd_start($cluster); for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ ) {