After placing an order Magento triggers a price reindex (which sometimes takes too long) and fails placing the order (because reindex is part of the transaction):
> SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try
> restarting transaction SQL Query: INSERT INTO
> `catalog_product_index_price_tmp` SELECT
> `catalog_product_index_price`.* FROM `catalog_product_index_price`
> WHERE (entity_id IN('39074', '39075', '39076', '39077', '39078',
> '49702', '49703', '49704', '49705', '49706', '49708', '52288',
> '52289', '52291', '52292')) SQL Params: Array ( )
And, because there is an email if the transaction fails, this seems to be expected (otherwise this email wouldn't be implemented).
In order to fix this, I moved the reindex outside the transaction, but I am still puzzled why this is needed.