I can see reproducible (testcase is attached) DBQueryError exceptions when multiple users try to CreateAccount via API simultaneously.
Function: User::addToDatabase\nError: 1213 Deadlock found when trying to get lock; try restarting transaction
I've been running a Selenium test in 5 browsers. The test starts with creating an account via api.php?action=createaccount, which sometimes fails with DBQueryError failures.
So I wrote a small testcase "send 10 async requests to api.php?action=createaccount". It fails 100% of the time (both for latest MediaWiki 1.31 and legacy MediaWiki 1.27).
Reproducible with 10.2.16-MariaDB, 10.3.8-MariaDB, MySQL 5.6.
Testcase to reproduce
npm install API=http://somewiki/w/api.php node ReproduceBug.js