dml_write_exception SQLSTATE 40001 on deadlock: retrying delegated transactions without duplicate writes
Deadlock retries in a Moodle plugin I am writing a Moodle 4.5 plugin whose scheduled task performs several related writes inside $DB->start_delegated_transaction() . Under concurrent load, MySQL can abort the transaction with a dml_write_exception carrying SQLSTATE 40001 (deadlock). As far as I can tell, Moodle's DML layer throws this exception but does n