Bug #68235 Stop slave sql_thread hangs in futex_wait in some cases (DEADLOCK)
Submitted: 31 Jan 2013 14:40 Modified: 28 Feb 2013 18:46
Reporter: Martijn Otto Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Locking Severity:S1 (Critical)
Version:5.6.9 OS:Linux
Assigned to: CPU Architecture:Any

[31 Jan 2013 14:40] Martijn Otto
Description:
During our MySQL 5.6 tests we have run into a problem where stopping the slave thread hangs in futex_wait forever. This problem only seems to happen when stopping the slave under heavy load and I have been unable to find a reproducable scenario.

The steps under which it happens are this:

- flush tables
- stop slave sql_thread

At this point, mysql tries to kill the slave thread, but hangs. Any queries related to the slave also hang, e.g. show slave status will block forever.

Running strace on the MySQL server process yields a futex_wait that the server does not move beyond.

How to repeat:
Run these queries a few time on a busy server:

- flush tables
- stop slave sql_thread

It does not happen every time, I have seen it happen mostly when the slave was executing LOAD DATA INFILE queries at the time of stopping it.

Suggested fix:
Wait for the slave query to finish and then stop the slave.
[31 Jan 2013 14:41] Martijn Otto
Running queries with the host and db removed

Attachment: queries.csv (text/comma-separated-values), 12.02 KiB.

[31 Jan 2013 18:46] MySQL Verification Team
If it happens again, please get stack traces from all threads.  That should be enough to pinpoint the problem via code analysis without being able to repeat it (hopefully):

gdb -ex "set pagination 0" -ex "thread apply all bt"  --batch -p $(pidof mysqld)
[1 Mar 2013 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".