summary refs log tree commit diff
path: root/synapse/storage/engines
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/storage/engines')
-rw-r--r--synapse/storage/engines/maria.py5
-rw-r--r--synapse/storage/engines/sqlite3.py3
2 files changed, 8 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
diff --git a/synapse/storage/engines/sqlite3.py b/synapse/storage/engines/sqlite3.py
index e802b5d5fd..72c11df461 100644
--- a/synapse/storage/engines/sqlite3.py
+++ b/synapse/storage/engines/sqlite3.py
@@ -32,3 +32,6 @@ class Sqlite3Engine(object):
     def prepare_database(self, db_conn):
         prepare_sqlite3_database(db_conn)
         prepare_database(db_conn, self)
+
+    def is_deadlock(self, error):
+        return False