Description:
Running mysql-5.6.8-rc-osx10.6-x86_64, the server stalls on shutdown if a client is connected. When "mysqladmin shutdown" is killed with CTRL-C it reports:
"""
Warning; Aborted waiting on pid file: '/tmp/12348/data/mysql_sandbox12348.pid' after 196 seconds
"""
However I think that's wrong because the PID file is still there:
"""
12348$ ls data/*.pid
data/mysql_sandbox12348.pid
"""
The real problem is that MySQL is stalled on shutdown. If no clients are connected, it always shuts down correctly.
This may be similar to bug 64643, but the fact that this bug is intermittent (i.e. sometimes MySQL actually kills the connected client but most times it doesn't) indicates that there's some problem.
Furthermore, if MySQL supposedly forcefully disconnected the client, (i.e. "121201 13:20:23 [Note] Forcefully disconnecting 1 remaining clients"), then what else is it waiting for?
Lastly, even if MySQL will eventually shut down after 3,600 second (1 hour) according to bug 64643, that is _way_ too long. Imho, even after 5 minutes most people will think that MySQL has gotten stuck (particularly since there are no more log messages indicating why or for what it's waiting).
How to repeat:
1) Start a server.
2) Connect a client and leave it connected.
3) mysqladmin shutdown
The mysqladmin and mysqld hang now. The MySQL log shows:
"""
121201 13:11:30 [Note] /Users/daniel/mysql-binaries/mysql-5.6.8-rc-osx10.6-x86_64/bin/mysqld: Normal shutdown
121201 13:11:30 [Note] Giving 1 client threads a chance to die gracefully
121201 13:11:30 [Note] Event Scheduler: Purging the queue. 0 events
121201 13:11:30 [Note] Shutting down slave threads
121201 13:11:32 [Note] Forcefully disconnecting 1 remaining clients
121201 13:11:32 [Warning] /Users/daniel/mysql-binaries/mysql-5.6.8-rc-osx10.6-x86_64/bin/mysqld: Forcing close of thread 2 user: 'msandbox'
"""
This happens most of the time, but every now and then it will work and the log will show that then:
"""
121201 13:10:40 [Note] Binlog end
121201 13:10:40 [Note] Shutting down plugin 'partition'
121201 13:10:40 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
121201 13:10:40 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
...
121201 13:10:40 [Note] Shutting down plugin 'InnoDB'
121201 13:10:40 [Note] InnoDB: FTS optimize thread exiting.
121201 13:10:40 [Note] InnoDB: Starting shutdown...
121201 13:10:42 [Note] InnoDB: Shutdown completed; log sequence number 1600634
121201 13:10:42 [Note] Shutting down plugin 'BLACKHOLE'
...
121201 13:10:42 [Note] Shutting down plugin 'binlog'
121201 13:10:42 [Note] /Users/daniel/mysql-binaries/mysql-5.6.8-rc-osx10.6-x86_64/bin/mysqld: Shutdown complete
"""