Fix bug where state_group tables got corrupted

This is due to the fact that we prefilled caches using txn.call_after,
which always gets called including on error.

We fix this by making txn.call_after only fire when a transaction
completes successfully, which is what we want most of the time anyway.
This commit is contained in:
Erik Johnston 2017-06-07 17:34:20 +01:00
parent 3accee1a8c
commit 197bd126f0
3 changed files with 24 additions and 10 deletions

View file

@ -225,7 +225,8 @@ class DataStore(RoomMemberStore, RoomStore,
db_conn.cursor(),
name="_find_stream_orderings_for_times_txn",
database_engine=self.database_engine,
after_callbacks=[]
after_callbacks=[],
final_callbacks=[],
)
self._find_stream_orderings_for_times_txn(cur)
cur.close()