From 62451800e7a35719bd152c957390a70d0d305707 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Thu, 5 Jan 2017 13:36:10 +0000 Subject: [PATCH 1/5] Bump version and changelog to v0.18.6-rc3 --- CHANGES.rst | 15 +++++++++++++++ synapse/__init__.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index dfa5d8748..82c8e38cc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,18 @@ +Changes in synapse v0.18.6-rc3 (2017-01-05) +=========================================== + +Bug fixes: + +* Fix bug where we failed to send ban events to the banned server (PR #1758) +* Fix bug where we sent event that didn't originate on this server to + other servers (PR #1764) +* Fix bug where processing an event from a remote server took a long time + because we were making long HTTP requests (PR #1765, PR #1744) + +Changes: + +* Improve logging for debugging deadlocks (PR #1766) + Changes in synapse v0.18.6-rc2 (2016-12-30) =========================================== diff --git a/synapse/__init__.py b/synapse/__init__.py index fbb2bb57b..a1da92ef9 100644 --- a/synapse/__init__.py +++ b/synapse/__init__.py @@ -16,4 +16,4 @@ """ This is a reference implementation of a Matrix home server. """ -__version__ = "0.18.6-rc2" +__version__ = "0.18.6-rc3" From 8cfc0165e913a140782538003fd61c2e01dcf81d Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 5 Jan 2017 13:39:43 +0000 Subject: [PATCH 2/5] fix annoying typos --- synapse/storage/roommember.py | 4 ++-- synapse/storage/state.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index 946d5a81c..5d18037c7 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -393,8 +393,8 @@ class RoomMemberStore(SQLBaseStore): @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 diff --git a/synapse/storage/state.py b/synapse/storage/state.py index 23e7ad992..7f466c40a 100644 --- a/synapse/storage/state.py +++ b/synapse/storage/state.py @@ -384,7 +384,7 @@ class StateStore(SQLBaseStore): # 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: From d79d1657617e5c050292b6676a9851c5674576da Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 5 Jan 2017 13:40:39 +0000 Subject: [PATCH 3/5] add logging for all the places we call resolve_state_groups. my kingdom for a backtrace that actually works. --- synapse/api/auth.py | 1 + synapse/handlers/federation.py | 1 + synapse/state.py | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/synapse/api/auth.py b/synapse/api/auth.py index a99986714..641f2bb06 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -290,6 +290,7 @@ class Auth(object): 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 ) diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 8c93d6d39..9ed708bf3 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -591,6 +591,7 @@ class FederationHandler(BaseHandler): 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 diff --git a/synapse/state.py b/synapse/state.py index b4eca0e5d..bbca59b1e 100644 --- a/synapse/state.py +++ b/synapse/state.py @@ -123,6 +123,7 @@ class StateHandler(object): 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 @@ -147,6 +148,7 @@ class StateHandler(object): 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 @@ -158,6 +160,7 @@ class StateHandler(object): @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) @@ -223,6 +226,7 @@ class StateHandler(object): 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], From 883ff92a7fe2c81639a521470854b198845aff0f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 5 Jan 2017 13:45:02 +0000 Subject: [PATCH 4/5] Fix case --- synapse/handlers/federation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 9ed708bf3..1021bcc40 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -591,7 +591,7 @@ class FederationHandler(BaseHandler): event_ids = list(extremities.keys()) - logger.info("Calling resolve_state_groups in _maybe_backfill") + 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 From c18f7fc41019be6a5c08df3f4976bd94435677c7 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Thu, 5 Jan 2017 13:50:22 +0000 Subject: [PATCH 5/5] Fix flake8 and update changelog --- CHANGES.rst | 2 +- synapse/api/auth.py | 2 +- synapse/state.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 82c8e38cc..c1a8dd761 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,7 +11,7 @@ Bug fixes: Changes: -* Improve logging for debugging deadlocks (PR #1766) +* Improve logging for debugging deadlocks (PR #1766, PR #1767) Changes in synapse v0.18.6-rc2 (2016-12-30) =========================================== diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 641f2bb06..f93e45a74 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -290,7 +290,7 @@ class Auth(object): 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"); + logger.info("calling resolve_state_groups from check_host_in_room") entry = yield self.state.resolve_state_groups( room_id, latest_event_ids ) diff --git a/synapse/state.py b/synapse/state.py index bbca59b1e..ba0d2a39a 100644 --- a/synapse/state.py +++ b/synapse/state.py @@ -123,7 +123,7 @@ class StateHandler(object): 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"); + logger.info("calling resolve_state_groups from get_current_state") ret = yield self.resolve_state_groups(room_id, latest_event_ids) state = ret.state @@ -148,7 +148,7 @@ class StateHandler(object): 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"); + 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 @@ -160,7 +160,7 @@ class StateHandler(object): @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"); + 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) @@ -226,7 +226,7 @@ class StateHandler(object): context.prev_state_events = [] defer.returnValue(context) - logger.info("calling resolve_state_groups from compute_event_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],