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

Commit f851ba5

Browse files
committed
Merge tag 'v1.58.0rc2' into babolivier/dinsic_1.58
Synapse 1.58.0rc2 (2022-04-26) ============================== This release candidate fixes bugs related to Synapse 1.58.0rc1's logic for handling device list updates. Bugfixes -------- - Fix a bug introduced in Synapse 1.58.0rc1 where the main process could consume excessive amounts of CPU and memory while handling sentry logging failures. ([\#12554](matrix-org/synapse#12554)) - Fix a bug introduced in Synapse 1.58.0rc1 where opentracing contexts were not correctly sent to whitelisted remote servers with device lists updates. ([\#12555](matrix-org/synapse#12555)) Internal Changes ---------------- - Reduce unnecessary work when handling remote device list updates. ([\#12557](matrix-org/synapse#12557))
2 parents 6734337 + 9cfecd2 commit f851ba5

File tree

6 files changed

+49
-10
lines changed

6 files changed

+49
-10
lines changed

CHANGES.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
Synapse 1.58.0rc2 (2022-04-26)
2+
==============================
3+
4+
This release candidate fixes bugs related to Synapse 1.58.0rc1's logic for handling device list updates.
5+
6+
Bugfixes
7+
--------
8+
9+
- Fix a bug introduced in Synapse 1.58.0rc1 where the main process could consume excessive amounts of CPU and memory while handling sentry logging failures. ([\#12554](https://github.com/matrix-org/synapse/issues/12554))
10+
- Fix a bug introduced in Synapse 1.58.0rc1 where opentracing contexts were not correctly sent to whitelisted remote servers with device lists updates. ([\#12555](https://github.com/matrix-org/synapse/issues/12555))
11+
12+
13+
Internal Changes
14+
----------------
15+
16+
- Reduce unnecessary work when handling remote device list updates. ([\#12557](https://github.com/matrix-org/synapse/issues/12557))
17+
18+
119
Synapse 1.58.0rc1 (2022-04-26)
220
==============================
321

@@ -9,7 +27,7 @@ Features
927
- Implement [MSC3383](https://github.com/matrix-org/matrix-spec-proposals/pull/3383) for including the destination in server-to-server authentication headers. Contributed by @Bubu and @jcgruenhage for Famedly. ([\#11398](https://github.com/matrix-org/synapse/issues/11398))
1028
- Docker images and Debian packages from matrix.org now contain a locked set of Python dependencies, greatly improving build reproducibility. ([Board](https://github.com/orgs/matrix-org/projects/54), [\#11537](https://github.com/matrix-org/synapse/issues/11537))
1129
- Enable processing of device list updates asynchronously. ([\#12365](https://github.com/matrix-org/synapse/issues/12365), [\#12465](https://github.com/matrix-org/synapse/issues/12465))
12-
- Implement [MSC2815](https://github.com/matrix-org/matrix-spec-proposals/pull/2815) to allow room moderators to view redacted event content. Contributed by @tulir. ([\#12427](https://github.com/matrix-org/synapse/issues/12427))
30+
- Implement [MSC2815](https://github.com/matrix-org/matrix-spec-proposals/pull/2815) to allow room moderators to view redacted event content. Contributed by @tulir @ Beeper. ([\#12427](https://github.com/matrix-org/synapse/issues/12427))
1331
- Build Debian packages for Ubuntu 22.04 "Jammy Jellyfish". ([\#12543](https://github.com/matrix-org/synapse/issues/12543))
1432

1533

debian/changelog

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
matrix-synapse-py3 (1.58.0~rc2) stable; urgency=medium
2+
3+
* New Synapse release 1.58.0rc2.
4+
5+
-- Synapse Packaging team <[email protected]> Tue, 26 Apr 2022 17:14:56 +0100
6+
17
matrix-synapse-py3 (1.58.0~rc1) stable; urgency=medium
28

39
* Use poetry to manage the bundled virtualenv included with this package.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ skip_gitignore = true
5454

5555
[tool.poetry]
5656
name = "matrix-synapse"
57-
version = "1.58.0rc1"
57+
version = "1.58.0rc2"
5858
description = "Homeserver for the Matrix decentralised comms protocol"
5959
authors = ["Matrix.org Team and Contributors <[email protected]>"]
6060
license = "Apache-2.0"

synapse/handlers/device.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,9 @@ async def notify_device_update(
505505
"device_list_key", position, users={user_id}, rooms=room_ids
506506
)
507507

508-
# We may need to do some processing asynchronously.
509-
self._handle_new_device_update_async()
508+
# We may need to do some processing asynchronously for local user IDs.
509+
if self.hs.is_mine_id(user_id):
510+
self._handle_new_device_update_async()
510511

511512
async def notify_user_signature_update(
512513
self, from_user_id: str, user_ids: List[str]
@@ -683,9 +684,12 @@ async def _handle_new_device_update_async(self) -> None:
683684
self.federation_sender.send_device_messages(
684685
host, immediate=False
685686
)
686-
log_kv(
687-
{"message": "sent device update to host", "host": host}
688-
)
687+
# TODO: when called, this isn't in a logging context.
688+
# This leads to log spam, sentry event spam, and massive
689+
# memory usage. See #12552.
690+
# log_kv(
691+
# {"message": "sent device update to host", "host": host}
692+
# )
689693

690694
if current_stream_id != stream_id:
691695
# Clear the set of hosts we've already sent to as we're

synapse/storage/databases/main/devices.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,8 @@ def _add_device_outbound_room_poke_txn(
17481748
device_id,
17491749
room_id,
17501750
stream_id,
1751-
False,
1751+
# We only need to calculate outbound pokes for local users
1752+
not self.hs.is_mine_id(user_id),
17521753
encoded_context,
17531754
)
17541755
for room_id in room_ids
@@ -1776,7 +1777,17 @@ async def get_uncoverted_outbound_room_pokes(
17761777

17771778
def get_uncoverted_outbound_room_pokes_txn(txn):
17781779
txn.execute(sql, (limit,))
1779-
return txn.fetchall()
1780+
1781+
return [
1782+
(
1783+
user_id,
1784+
device_id,
1785+
room_id,
1786+
stream_id,
1787+
db_to_json(opentracing_context),
1788+
)
1789+
for user_id, device_id, room_id, stream_id, opentracing_context in txn
1790+
]
17801791

17811792
return await self.db_pool.runInteraction(
17821793
"get_uncoverted_outbound_room_pokes", get_uncoverted_outbound_room_pokes_txn

tests/storage/test_devices.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def add_device_change(self, user_id, device_ids, host):
2929
for device_id in device_ids:
3030
stream_id = self.get_success(
3131
self.store.add_device_change_to_streams(
32-
"user_id", [device_id], ["!some:room"]
32+
user_id, [device_id], ["!some:room"]
3333
)
3434
)
3535

0 commit comments

Comments
 (0)