Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Use FOR UPDATE to ensure selects conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Nov 5, 2023
1 parent d90cef1 commit 4dbee68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/storage/databases/main/push_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def _add_push_rule_relative_txn(
"""

if isinstance(self.database_engine, PostgresEngine):
sql += " FOR SHARE"
sql += " FOR UPDATE"
else:
# Annoyingly SQLite doesn't support row level locking, so lock the whole table
self.database_engine.lock_table(txn, "push_rules")
Expand Down

0 comments on commit 4dbee68

Please sign in to comment.