Bug #34957 Mysqld hangs at shutdown
Submitted: 29 Feb 2008 8:29 Modified: 22 May 2012 15:41
Reporter: Sander Pilon Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.1.23-rc-log, 5.1.30 OS:FreeBSD (7.0-RELEASE)
Assigned to: CPU Architecture:Any

[29 Feb 2008 8:29] Sander Pilon
Description:
Often, but not always, mysqld hangs on freebsd 7.0 when shutting down.

I see this in the log:

---
080229  9:04:01 [Note] /usr/local/libexec/mysqld: Normal shutdown
080229  9:04:01 [Note] Event Scheduler: Purging the queue. 0 events
080229  9:04:01 [Note] Slave I/O thread killed while reading event
080229  9:04:01 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.002970', position 4372685
080229  9:04:01 [Note] Error reading relay log event: slave SQL thread was killed
080229  9:04:03 [Warning] /usr/local/libexec/mysqld: Forcing close of thread 35095  user: 'main'
---

After this, I have waited 15+ minutes but nothing happens. No serious I/O is happening on the server. (It is definitely not flushing logs) 

The CPU is at 100% all that time.

All tables are InnoDB. 

---
innodb_buffer_pool_size=2500M
innodb_additional_mem_pool_size=75M
innodb_log_file_size=250M
innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=2
innodb_thread_concurrency=8
innodb_lock_wait_timeout=120
innodb_flush_method=O_DIRECT
innodb_file_per_table
---

Server is a dual core xeon, 4Gb of RAM.

How to repeat:
Shutdown mysql after a while.
[29 Feb 2008 8:33] Sander Pilon
I forgot to mention - this is an amd64 box.

/usr/local/libexec/mysqld  Ver 5.1.23-rc-log for portbld-freebsd7.0 on amd64 (FreeBSD port: mysql-server-5.1.23)
[29 Feb 2008 18:15] Valeriy Kravchuk
Thank you for a problem report. While it hangs on shutdown, can you connect and get SHOR FULL PROCESSLIST and SHOW INNODB STATUS results?
[29 Feb 2008 18:24] Sander Pilon
No, the daemon is not responding to anything.
[2 Jul 2008 16:20] Valeriy Kravchuk
Please, try to repeat with a newer version, 5.1.25, and inform about the results.
[2 Aug 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[18 Apr 2012 2:49] anders lin
Here is another case I met.

120416  3:37:23 [Note] E:\Program Files\MySQL\MySQL Server 5.1\\bin\mysqld.exe: Normal shutdown

120416  3:37:23 [Note] Event Scheduler: Purging the queue. 0 events
120416  3:37:25 [Warning] E:\Program Files\MySQL\MySQL Server 5.1\\bin\mysqld.exe: Forcing close of thread 491  user: 'root'

the mysql version is 5.1.30
[18 Apr 2012 2:56] anders lin
when i forced kill the mysql process and restarted it, it came the following:

InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!

120416  9:57:39  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...

It seems that innodb failed to write its log.
[22 Apr 2012 15:41] Valeriy Kravchuk
Please, check if the same problem still happens with a recent version, 5.1.62.
[23 May 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".