SLEEP thread causing "Waiting for table metadata lock"
We might have faced some
scenarios once our db connection threads are getting locked and
we try to find the culprit thread id which is locking the thread,
to kill and release the connections.
Here I am going to focus on one of the scenarios when db
connection threads are locked at state "waiting for table
metadata lock" and when we see the processlist, we can't find any
thread which is running and using the same table, i.e., all
threads are in SLEEP state except the locked threads.
Such as :
mysql [localhost:5726] {msandbox} (world) > show …