mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 11:39:21 -05:00
Fix race in presence handler where we evicted things from cache while handling a key therein
This commit is contained in:
parent
71fb748d70
commit
de55ba218f
@ -796,11 +796,12 @@ class PresenceEventSource(object):
|
|||||||
updates = []
|
updates = []
|
||||||
# TODO(paul): use a DeferredList ? How to limit concurrency.
|
# TODO(paul): use a DeferredList ? How to limit concurrency.
|
||||||
for observed_user in cachemap.keys():
|
for observed_user in cachemap.keys():
|
||||||
if not (from_key < cachemap[observed_user].serial):
|
cached = cachemap[observed_user]
|
||||||
|
if not (from_key < cached.serial):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if (yield self.is_visible(observer_user, observed_user)):
|
if (yield self.is_visible(observer_user, observed_user)):
|
||||||
updates.append((observed_user, cachemap[observed_user]))
|
updates.append((observed_user, cached))
|
||||||
|
|
||||||
# TODO(paul): limit
|
# TODO(paul): limit
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user