Skip to content
Snippets Groups Projects
Commit 07929bd6 authored by Richard van der Hoff's avatar Richard van der Hoff
Browse files

Merge tag 'v1.6.0rc2' into develop

Synapse 1.6.0rc2 (2019-11-25)
=============================

Bugfixes
--------

- Fix a bug which could cause the background database update hander for event labels to get stuck in a loop raising exceptions. ([\#6407](https://github.com/matrix-org/synapse/issues/6407))
parents 9eebd460 f9c9e1f0
No related branches found
No related tags found
No related merge requests found
Synapse 1.6.0rc2 (2019-11-25)
=============================
Bugfixes
--------
- Fix a bug which could cause the background database update hander for event labels to get stuck in a loop raising exceptions. ([\#6407](https://github.com/matrix-org/synapse/issues/6407))
Synapse 1.6.0rc1 (2019-11-20) Synapse 1.6.0rc1 (2019-11-20)
============================= =============================
......
...@@ -36,7 +36,7 @@ try: ...@@ -36,7 +36,7 @@ try:
except ImportError: except ImportError:
pass pass
__version__ = "1.6.0rc1" __version__ = "1.6.0rc2"
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)): if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
# We import here so that we don't have to install a bunch of deps when # We import here so that we don't have to install a bunch of deps when
......
...@@ -530,24 +530,31 @@ class EventsBackgroundUpdatesStore(BackgroundUpdateStore): ...@@ -530,24 +530,31 @@ class EventsBackgroundUpdatesStore(BackgroundUpdateStore):
nbrows = 0 nbrows = 0
last_row_event_id = "" last_row_event_id = ""
for (event_id, event_json_raw) in results: for (event_id, event_json_raw) in results:
event_json = json.loads(event_json_raw) try:
event_json = json.loads(event_json_raw)
self._simple_insert_many_txn(
txn=txn, self._simple_insert_many_txn(
table="event_labels", txn=txn,
values=[ table="event_labels",
{ values=[
"event_id": event_id, {
"label": label, "event_id": event_id,
"room_id": event_json["room_id"], "label": label,
"topological_ordering": event_json["depth"], "room_id": event_json["room_id"],
} "topological_ordering": event_json["depth"],
for label in event_json["content"].get( }
EventContentFields.LABELS, [] for label in event_json["content"].get(
) EventContentFields.LABELS, []
if isinstance(label, str) )
], if isinstance(label, str)
) ],
)
except Exception as e:
logger.warning(
"Unable to load event %s (no labels will be imported): %s",
event_id,
e,
)
nbrows += 1 nbrows += 1
last_row_event_id = event_id last_row_event_id = event_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment