Bug #87473 "bin/mysqladmin" does not have a "--shutdown-timeout" anymore
Submitted: 18 Aug 2017 10:46 Modified: 26 Dec 2017 8:20
Reporter: Nils Fahldieck Email Updates:
Status: Analyzing Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S1 (Critical)
Version:5.6.37 OS:Debian (8)
Assigned to: Assigned Account CPU Architecture:Any
Tags: mysqladmin, shutdown, shutdown-timeout, timeout

[18 Aug 2017 10:46] Nils Fahldieck
Description:
With the current MySQL version 5.6.37 there's what seems like a bug in the tool "mysqladmin".

Upon using the "shutdown" command, there's no shutdown-timeout anymore.

This was still working in version 5.6.35.

This way the mysqladmin command always returns RC=0, although the server is not yet stopped. This might lead to potential data loss during e.g. shutting down the entire system.

How to repeat:
Using this command, there's no default --shutdown-timeout:
  /usr/local/mysql5/bin/mysqladmin --defaults-file=/etc/mysql5/maint.cnf shutdown

According to the help page, there should be a default timeout of '3600'.

Explicitly defining a --shutdown-timeout is also ignored:
  /usr/local/mysql5/bin/mysqladmin --defaults-file=/etc/mysql5/maint.cnf --shutdown-timeout=5000 shutdown

An easy way to see what I mean is issuing this command:
  /usr/local/mysql5/bin/mysqladmin --defaults-file=/etc/mysql5/ph-sys-maint.cnf --shutdown-timeout=5000 shutdown ; ps aux | grep mysqld

The ps output shows mysqld still running. Checking a second time, mysld is stopped.

#################################
content of /etc/mysql5/maint.cnf:
[client]
host     = localhost
user     = ********
password = ********
socket   = /home/tmp/mysql5.sock

[mysql_upgrade]
host     = localhost
user     = ********
password = ********
socket   = /home/tmp/mysql5.sock
basedir  = /usr/local/mysql5