Our Java/Spring application reports occasional lock wait timeouts on single record INSERTs to a MySQL 5.5 InnoDB table. Here are a few slow query log records for some of the failed INSERTs.
# Query_time: 51.472333 Lock_time: 0.000090 Rows_sent: 0 Rows_examined: 0
SET timestamp=1340049365;
insert into Foo ( ...
# Query_time: 51.045967 Lock_time: 0.000131 Rows_sent: 0 Rows_examined: 0
SET timestamp=1340049476;
insert into Foo ( ...
# Query_time: 50.693427 Lock_time: 0.000128 Rows_sent: 0 Rows_examined: 0
SET timestamp=1340049561;
insert into Foo ( ...
Clearly the queries are hanging for a long time and seem to be hitting the exception right at around 50s, but the short lock time does not make sense to me. What can the queries be waiting for if not some lock? Would someone please shed some light onto this?