Bug #39205 --shutdown_server does not work
Submitted: 3 Sep 2008 6:06 Modified: 10 Feb 2011 11:46
Reporter: Hakan Küçükyılmaz Email Updates:
Status: Closed Impact on me:
None 
Category:Tests Severity:S7 (Test Cases)
Version:6.0, 6.0-falcon, 5.1 OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[3 Sep 2008 6:06] Hakan Küçükyılmaz
Description:
According to http://dev.mysql.com/doc/mysqltest/en/mysqltest-commands.html

 shutdown_server [timeout]

Stops the server. This command waits for the server to shut down by monitoring its process ID (PID) file. If the server's process ID file is not gone after timeout seconds, the process will be killed. If timeout is omitted, the default is 60 seconds.

However, --shutdown_server seems not to work in latest 6.0 and 6.0-falcon bzr trees.

How to repeat:
Write a test which consists of two parts and check server uptime like:

File 1:

#
# Test whether --shutdown_server works. Part I/II.
#
SHOW GLOBAL STATUS LIKE 'Uptime';
--real_sleep 3
SHOW GLOBAL STATUS LIKE 'Uptime';
--shutdown_server

File 2:
#
# Test whether --shutdown_server works. Part II/II.
#
--real_sleep 3
# Uptime should be 3 or 4 but not 6!
SHOW GLOBAL STATUS LIKE 'Uptime';

main.shutdown_server_I         [ pass ]           3004
main.shutdown_server_II        [ fail ]

--- /home/hakan/work/mysql/mysql-6.0-falcon-team/mysql-test/r/shutdown_server_II.result 2008-09-03 08:48:48.000000000 +0300
+++ /home/hakan/work/mysql/mysql-6.0-falcon-team/mysql-test/r/shutdown_server_II.reject 2008-09-03 08:48:55.000000000 +0300
@@ -1,3 +1,3 @@
 SHOW GLOBAL STATUS LIKE 'Uptime';
 Variable_name  Value
-Uptime 3
+Uptime 6

mysqltest: Result content mismatch
[3 Sep 2008 6:07] Hakan Küçükyılmaz
shutdown_server_I.test and shutdown_server_II.test with corresponding .result files

Attachment: shutdown_server.tar.gz (application/x-gzip, text), 375 bytes.

[3 Sep 2008 6:49] Sveta Smirnova
Thank you for the report.

Verified as described.
[3 Sep 2008 7:19] Hakan Küçükyılmaz
From the documentation:
    This command was added in MySQL 5.1.26/6.0.6.

Therefore removed 5.0 from version list.
[3 Sep 2008 14:06] Hakan Küçükyılmaz
I get this error when using include/restart_mysqld.inc like

File 1:

#
# Test whether --shutdown_server works. Part I/II.
#
SHOW GLOBAL STATUS LIKE 'Uptime';
--real_sleep 3
SHOW GLOBAL STATUS LIKE 'Uptime';

--source include/restart_mysqld.inc

main.shutdown_server_I         [ fail ]

mysqltest: In included file "./include/restart_mysqld.inc": At line 10: query 'shutdown_server 10' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'shutdown_server 10' at line 1
[31 Oct 2008 10:28] Magnus Blåudd
Looks like shutdown_server is still in 5.1-rpl and 6.0-rpl ie. it has not reached the mian 5.1 and 6.0 trees. The documentation update was an error.
[11 Nov 2008 13:01] John Embretsen
The --source include/restart_mysqld.inc feature does not seems to work properly in valgrind and possibly other "slow" configurations, see Bug#40636 (falcon_bug_28095 test fails with "Server failed to restart" in valgrind runs).
[8 Jun 2009 16:22] Daniel Fischer
Please re-verify, it looks like the code is there at this time.
[8 Jun 2009 20:27] Sveta Smirnova
Currently test shutdown_server_I  fails with:

main.shutdown_server_I                   [ fail ]
        Test ended at 2009-06-08 22:21:14

CURRENT_TEST: main.shutdown_server_I

Server [mysqld.1 - pid: 16955, winpid: 16955, exit: 0] failed during test run
[10 Feb 2011 11:46] Bjørn Munch
shutdown_server has been supported for a long time now, closing this old bug