Bug #36874 main.slow_launch_time_func test fails randomly
Submitted: 22 May 2008 6:23 Modified: 17 Oct 2008 17:32
Reporter: Konstantin Osipov (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:6.0, 5.1 OS:Any
Assigned to: Matthias Leich CPU Architecture:Any

[22 May 2008 6:23] Konstantin Osipov
Description:
The test fails with the following symptoms:

--- /export/home/pushbuild/pb/mysql-6.0-runtime/277/mysql-6.0.6-alpha-pb277/mysql-test/r/slow_launch_time_func.result	Wed May 21 23:19:02 2008
+++ /export/home/pushbuild/pb/mysql-6.0-runtime/277/mysql-6.0.6-alpha-pb277/mysql-test/r/slow_launch_time_func.reject	Thu May 22 02:34:02 2008
@@ -19,7 +19,7 @@
 ** Connecting conn16 using username 'root' **
 show status like 'slow_launch_threads';
 Variable_name	Value
-Slow_launch_threads	12
+Slow_launch_threads	0
 12 Expected
 ** Connection default **
 ** Disconnecting conn5 **

How to repeat:
https://intranet.mysql.com/secure/pushbuild/getlog.pl?dir=mysql-6.0-runtime&entry=kosipov@...

Suggested fix:
Variable slow_launch_time and slow_launch_threads was introduced by Sasha Pachev in May 2000 and since then no one cared about its existence.
The test has a race, or the server code has a bug:

The way this variable is incremented is:
 
  if (launch_time >= slow_launch_time*1000000L)
    statistic_increment(slow_launch_threads,&LOCK_status);

which means that all slow launches under 1 second will not be recorded.

The fix is to change the minimal allowed value of the slow_launch_time and change the test (at least), but after that other races may pop up.
[28 Aug 2008 17:15] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/52866

2731 Horst Hunger	2008-08-28
      Fix for bug#36874: Inserted waiting until all connects have been executed.
[8 Sep 2008 13:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53531
[8 Sep 2008 13:53] Matthias Leich
The fix this bug must start in 5.1 because we have
there the same weakness and the same significant
probability for the failure.
[12 Sep 2008 10:09] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53952
[2 Oct 2008 13:42] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/55080

2747 Matthias Leich	2008-10-02
      Fix for Bug#36874 : main.slow_launch_time_func test fails
[6 Oct 2008 10:14] Matthias Leich
Pushed to
mysql-5.1-bugteam
mysql-6.0-bugteam
[9 Oct 2008 17:38] Bugs System
Pushed into 5.1.30  (revid:matthias.leich@sun.com-20081004160009-yir3rwynd79v8jp3) (version source revid:mats@sun.com-20081008113713-2vxny72m5w1tywoi) (pib:4)
[15 Oct 2008 15:04] Paul DuBois
This is actually pushed to 5.1.29, not 5.1.30.
[15 Oct 2008 17:16] Paul DuBois
Test case changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[17 Oct 2008 16:41] Bugs System
Pushed into 6.0.8-alpha  (revid:matthias.leich@sun.com-20081004164917-ly18y5m21rz1l2dz) (version source revid:matthias.leich@sun.com-20081004164917-ly18y5m21rz1l2dz) (pib:5)
[17 Oct 2008 17:32] Paul DuBois
No changelog entry needed.
[28 Oct 2008 21:01] Bugs System
Pushed into 5.1.29-ndb-6.2.17  (revid:matthias.leich@sun.com-20081004160009-yir3rwynd79v8jp3) (version source revid:tomas.ulin@sun.com-20081028140209-u4emkk1xphi5tkfb) (pib:5)
[28 Oct 2008 22:20] Bugs System
Pushed into 5.1.29-ndb-6.3.19  (revid:matthias.leich@sun.com-20081004160009-yir3rwynd79v8jp3) (version source revid:tomas.ulin@sun.com-20081028194045-0353yg8cvd2c7dd1) (pib:5)
[1 Nov 2008 9:45] Bugs System
Pushed into 5.1.29-ndb-6.4.0  (revid:matthias.leich@sun.com-20081004160009-yir3rwynd79v8jp3) (version source revid:jonas@mysql.com-20081101082305-qx5a1bj0z7i8ueys) (pib:5)