From 49d6aa1394bba42d52cae4013f7103d682756b28 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 7 Apr 2015 15:28:37 +0100 Subject: Retry on deadlock --- synapse/storage/engines/maria.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'synapse/storage/engines/maria.py') 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 -- cgit 1.4.1