Bug #43570 MTR2 hangs when test fails and named pipe created
Submitted: 11 Mar 2009 17:39 Modified: 29 May 2009 1:12
Reporter: Ingo Strüwing Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S7 (Test Cases)
Version:5.1+ OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[11 Mar 2009 17:39] Ingo Strüwing
Description:
When setting the server variable 'backupdir', creating a named pipe, and not removing the pipe before test end, MTR2 hangs indefinitely (suite-timeout works though). There must not be a writer on the pipe. When writing to the pipe, MTR2 awakes and finishes.

I report this against MTR2 because mysqld, mysqltest, and all other clients exit normally. Only two perl processes remain.

The problem with this bug is that mysqltest exits if any unexpected error happens. This does not leave a chance for removing the pipe.

Using --no-check-testcase does not avoid the hang.

How to repeat:
Take an arbitrary test case, e.g. backup_default.
Insert these lines somewhere, e.g. at the end:

SET @old_backupdir = @@backupdir;
SET @@global.backupdir = @old_backupdir;
--exec mkfifo $MYSQLTEST_VARDIR/tmp/backup_fifo

As you can see, it is not required to actually change 'backupdir' to some specific value. It is sufficient to set it to same value it has already.

It is not necessary to do anything with the named pipe. Just create it.

Run the test like:

(cd mysql-test && ./mysql-test-run.pl --parallel=1 backup_default)

When the test hangs, look at the system's process list, e.g. ps -fe. You will notice that no mysqld, mysqltest, mysqladmin, or whatever exist, unless from independent usage (other tests or other applications).

You can release MTR from the hang by:

echo > mysql-test/var/tmp/backup_fifo

Note that the path of the named pipe may vary if not --parallel=1 is given.
[11 Mar 2009 17:48] Ingo Strüwing
Suggested triage values:
Defect: medium. Not critical, but destroys a test run when it happens.
Workaround: none. Test case cleanup doesn't help if an unexpected error happens.
Impact: substantial. All pushbuild tests are in danger as we need to test pipes.
[1 Apr 2009 14:00] Bjørn Munch
This has notning to do with setting backup dir; any test that fails and has created pipes will hang while MTR tries to copy the tmp directory.
[1 Apr 2009 14:25] 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/71097

2780 Bjorn Munch	2009-04-01
      Bug #43570 MTR2 hangs when test fails and named pipe created
      Hangs when trying to copy the pipe
      Amend copytree() to only copy regular files
      modified:
        mysql-test/lib/My/File/Path.pm
[1 Apr 2009 20:30] Bjørn Munch
Pushed to 6.0-mtr and 5.1-mtr
[14 May 2009 16:25] Bugs System
Pushed into 6.0.12-alpha (revid:alik@sun.com-20090514161729-xiup7q8jlu1zfy7s) (version source revid:bjorn.munch@sun.com-20090401202316-ft6r1mluuyuq0knq) (merge vers: 6.0.11-alpha) (pib:6)
[15 May 2009 1:20] Paul DuBois
Test suite changes. No changelog entry needed.

Setting report to NDI pending push into 5.1.x.
[28 May 2009 8:15] Bugs System
Pushed into 5.1.36 (revid:joro@sun.com-20090528073639-yohsb4q1jzg7ycws) (version source revid:bjorn.munch@sun.com-20090525205831-zitq9aysxy5zgf5r) (merge vers: 5.1.36) (pib:6)
[29 May 2009 1:12] Paul DuBois
Test suite change. No changelog entry needed.
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:32] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)