Database deadlock detected On Drupal 8 we're getting a few deadlock conditions - most connected with the cache. There are quite a few answers to this issue but not so much for D8 (which has very different caching mechanism). Is there any way to resolve/mitigate?

Drupal\Core\Entity\EntityStorageException: SQLSTATE[40P01]: Deadlock detected: 7 ERROR: deadlock detected DETAIL: 
Process 9131 waits for ShareRowExclusiveLock on relation 8341492 of database 8341380; blocked by process 9130. 
Process 9130 waits for ShareRowExclusiveLock on relation 8341562 of database 8341380; blocked by process 9131. 
HINT: See server log for query details.: LOCK TABLE {cache_bootstrap} IN SHARE ROW EXCLUSIVE MODE; 
Array ( ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage-&gt;save() 
    (line 847 of /var/xxx/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
You can try and add the following lines to your settings.php file :
$databases['default']['default']['init_commands'] = array(
  'isolation' =&gt; &quot;SET SESSION tx_isolation='READ-COMMITTED'&quot;
);

https://support.acquia.com/hc/en-us/articles/360005253954-Fixing-database-deadlocks