8000 log call paths for resolve_state_group by ara4n · Pull Request #1767 · matrix-org/synapse · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

log call paths for resolve_state_group #1767

Merged
merged 3 commits into from
Jan 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions synapse/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ def check_host_in_room(self, room_id, host):
with Measure(self.clock, "check_host_in_room"):
latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id)

logger.info("calling resolve_state_groups from check_host_in_room");
entry = yield self.state.resolve_state_groups(
room_id, latest_event_ids
)
Expand Down
1 change: 1 addition & 0 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ def try_backfill(domains):

event_ids = list(extremities.keys())

logger.info("calling resolve_state_groups in _maybe_backfill")
states = yield preserve_context_over_deferred(defer.gatherResults([
preserve_fn(self.state_handler.resolve_state_groups)(room_id, [e])
for e in event_ids
Expand Down
4 changes: 4 additions & 0 deletions synapse/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def get_current_state(self, room_id, event_type=None, state_key="",
if not latest_event_ids:
latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id)

logger.info("calling resolve_state_groups from get_current_state");
ret = yield self.resolve_state_groups(room_id, latest_event_ids)
state = ret.state

Expand All @@ -147,6 +148,7 @@ def get_current_state_ids(self, room_id, event_type=None, state_key="",
if not latest_event_ids:
latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id)

logger.info("calling resolve_state_groups from get_current_state_ids");
ret = yield self.resolve_state_groups(room_id, latest_event_ids)
state = ret.state

Expand All @@ -158,6 +160,7 @@ def get_current_state_ids(self, room_id, event_type=None, state_key="",

@defer.inlineCallbacks
def get_current_user_in_room(self, room_id, latest_event_ids=None):
logger.info("calling resolve_state_groups from get_current_user_in_room");
if not latest_event_ids:
latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id)
entry = yield self.resolve_state_groups(room_id, latest_event_ids)
Expand Down Expand Up @@ -223,6 +226,7 @@ def compute_event_context(self, event, old_state=None):
context.prev_state_events = []
defer.returnValue(context)

logger.info("calling resolve_state_groups from compute_event_context");
if event.is_state():
entry = yield self.resolve_state_groups(
event.room_id, [e for e, _ in event.prev_events],
Expand Down
4 changes: 2 additions & 2 deletions synapse/storage/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ def get_joined_users_from_state(self, room_id, state_group, state_ids):
@cachedInlineCallbacks(num_args=2, cache_context=True)
def _get_joined_users_from_context(self, room_id, state_group, current_state_ids,
cache_context, event=None):
# We don't use `state_group`, its there so that we can cache based
# on it. However, its important that its never None, since two current_state's
# We don't use `state_group`, it's there so that we can cache based
# on it. However, it's important that it's never None, since two current_states
# with a state_group of None are likely to be different.
# See bulk_get_push_rules_for_room for how we work around this.
assert state_group is not None
Expand Down
2 changes: 1 addition & 1 deletion synapse/storage/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def _get_state_groups_from_groups_txn(self, txn, groups, types=None):
# We did this before by getting the list of group ids, and
# then passing that list to sqlite to get latest event for
# each (type, state_key). However, that was terribly slow
# without the right indicies (which we can't add until
# without the right indices (which we can't add until
# after we finish deduping state, which requires this func)
args = [next_group]
if types:
Expand Down
0