Deadlock Diagnosis This blog records the process to diagnose a deadlock in test environment for future possible similar situation to reuse the methodology and commands. State Suddenly, requests to some paths of a microservice return 504 (Gateway timeout). The strange thing is other microservice works find and even stranger, some requests for other paths in that microservice can work. We soon find those failed requests are all write request for databases, so we guess it might be a transaction lock in MySQL. MySQL Lock In order to find whether there is some deadlocks in MySQL, we used the following commands: # identify locked tables show open tables where In_use > 0 ; # displays the [InnoDB Monitor](https://mariadb.com/kb/en/xtradbinnodb-monitors/) output, which is extensive InnoDB information (include transaction info) which can be useful in diagnosing problems. show engine innodb status ; # show process connected to mysql SHOW PROCESSLIST ...
Learn programming, still on the way