summary refs log tree commit diff
path: root/synapse/storage/engines/maria.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-07 15:28:37 +0100
committerErik Johnston <erik@matrix.org>2015-04-07 15:28:37 +0100
commit49d6aa1394bba42d52cae4013f7103d682756b28 (patch)
tree6b163ad6d090be23dde9e7951bc455cb2fcfef54 /synapse/storage/engines/maria.py
parentPEP8 (diff)
downloadsynapse-49d6aa1394bba42d52cae4013f7103d682756b28.tar.xz
Retry on deadlock
Diffstat (limited to 'synapse/storage/engines/maria.py')
-rw-r--r--synapse/storage/engines/maria.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/engines/maria.py b/synapse/storage/engines/maria.py
index 7fcb706a60..a279bfaf44 100644
--- a/synapse/storage/engines/maria.py
+++ b/synapse/storage/engines/maria.py
@@ -40,3 +40,8 @@ class MariaEngine(object):
         )
         db_conn.commit()
         prepare_database(db_conn, self)
+
+    def is_deadlock(self, error):
+        if isinstance(error, self.module.InternalError):
+            return error.sqlstate == 40001 and error.errno == 1213
+        return False