mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Synapse 1.51.0rc2 (2022-01-24)
============================== Bugfixes -------- - Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](https://github.com/matrix-org/synapse/issues/11806)) -----BEGIN PGP SIGNATURE----- iQJHBAABCAAxFiEEgQG31Z317NrSMt0QiISIDS7+X/QFAmHum5QTHGFuZHJld0Bh bW9yZ2FuLnh5egAKCRCIhIgNLv5f9G6vD/9Dw6V0687vzahnU6aYWaecRSO1sbww EtcCiXOh0r8HXPAwEIXJYomSTTbPl0eAwP8T1the1WZVQArvRW2VvMzDoBheO8bt dCm4CTKFCGUsI/GrlFDPtjAEd6kruAETmpHZn7bAFSqtIpissD6FjUwg/ND/NJfM zVM/bMgM0+js6eD9J5/k16E1ZWj7Lbp+/fKN+qTeQrXzIeT13WQZ4Nz1o/cqe/21 o/coI3FmYq8CzKpfA6qZMDd/OtYpYqwwr7otSmW+6qHeZI/yqeoxlpzfgSZGpRUe mtXqbQllZQeqrbm8oK96GNmKcThy6awTwJPoD46b1AOkmFdf/lGSqO0lnTQRRPqR hyPPdrx6Lt2t7DDbVVyUElzkqLPhVJtrItPDC8669sWvmSgsPQdUqIsRmhF+8aJe ffjRvKbGRICnNZkT+qGf1HwuMHajZyAIHAS/kyFDKUZCvau3VQ1wlyOqVQ1hWr7+ 3k3CobjSx4y1bYKXncAK6hWH6lE8M319jaTnVfYXocDLWRonyFf7o286Q+c8WBGF tY0FzvUPb5S2kktC4WLwcqtcTWK1cu5MI6GfD69EqL7iifJRVyKDeUoD7tiUvgzN O2wBl2soJIsAU+8y16WQu7p+k2nZIomCCAySnW3C8mlxvv7CKQu0Url8J7IH8uZE ZVN2MMe7H+ZHJQ== =Fpsa -----END PGP SIGNATURE----- Merge tag 'v1.51.0rc2' into develop Synapse 1.51.0rc2 (2022-01-24) ============================== Bugfixes -------- - Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](https://github.com/matrix-org/synapse/issues/11806))
This commit is contained in:
commit
c3040dd5cc
@ -1,3 +1,12 @@
|
||||
Synapse 1.51.0rc2 (2022-01-24)
|
||||
==============================
|
||||
|
||||
Bugfixes
|
||||
--------
|
||||
|
||||
- Fix a bug introduced in Synapse 1.40.0 that caused Synapse to fail to process incoming federation traffic after handling a large amount of events in a v1 room. ([\#11806](https://github.com/matrix-org/synapse/issues/11806))
|
||||
|
||||
|
||||
Synapse 1.51.0rc1 (2022-01-21)
|
||||
==============================
|
||||
|
||||
|
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
||||
matrix-synapse-py3 (1.51.0~rc2) stable; urgency=medium
|
||||
|
||||
* New synapse release 1.51.0~rc2.
|
||||
|
||||
-- Synapse Packaging team <packages@matrix.org> Mon, 24 Jan 2022 12:25:00 +0000
|
||||
|
||||
matrix-synapse-py3 (1.51.0~rc1) stable; urgency=medium
|
||||
|
||||
* New synapse release 1.51.0~rc1.
|
||||
|
@ -47,7 +47,7 @@ try:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
__version__ = "1.51.0rc1"
|
||||
__version__ = "1.51.0rc2"
|
||||
|
||||
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
|
||||
|
@ -1432,7 +1432,10 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas
|
||||
|
||||
if room_version.event_format == EventFormatVersions.V1:
|
||||
for prev_event_tuple in prev_events:
|
||||
if not isinstance(prev_event_tuple, list) or len(prev_events) != 2:
|
||||
if (
|
||||
not isinstance(prev_event_tuple, list)
|
||||
or len(prev_event_tuple) != 2
|
||||
):
|
||||
logger.info("Invalid prev_events for %s", event_id)
|
||||
break
|
||||
|
||||
|
@ -12,10 +12,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from typing import Tuple, Union
|
||||
|
||||
import attr
|
||||
from parameterized import parameterized
|
||||
|
||||
from synapse.api.room_versions import RoomVersions
|
||||
from synapse.api.room_versions import (
|
||||
KNOWN_ROOM_VERSIONS,
|
||||
EventFormatVersions,
|
||||
RoomVersion,
|
||||
)
|
||||
from synapse.events import _EventInternalMetadata
|
||||
from synapse.util import json_encoder
|
||||
|
||||
@ -506,11 +512,21 @@ class EventFederationWorkerStoreTestCase(tests.unittest.HomeserverTestCase):
|
||||
)
|
||||
self.assertSetEqual(difference, set())
|
||||
|
||||
def test_prune_inbound_federation_queue(self):
|
||||
"Test that pruning of inbound federation queues work"
|
||||
@parameterized.expand(
|
||||
[(room_version,) for room_version in KNOWN_ROOM_VERSIONS.values()]
|
||||
)
|
||||
def test_prune_inbound_federation_queue(self, room_version: RoomVersion):
|
||||
"""Test that pruning of inbound federation queues work"""
|
||||
|
||||
room_id = "some_room_id"
|
||||
|
||||
def prev_event_format(prev_event_id: str) -> Union[Tuple[str, dict], str]:
|
||||
"""Account for differences in prev_events format across room versions"""
|
||||
if room_version.event_format == EventFormatVersions.V1:
|
||||
return prev_event_id, {}
|
||||
|
||||
return prev_event_id
|
||||
|
||||
# Insert a bunch of events that all reference the previous one.
|
||||
self.get_success(
|
||||
self.store.db_pool.simple_insert_many(
|
||||
@ -529,7 +545,9 @@ class EventFederationWorkerStoreTestCase(tests.unittest.HomeserverTestCase):
|
||||
room_id,
|
||||
0,
|
||||
f"$fake_event_id_{i + 1}",
|
||||
json_encoder.encode({"prev_events": [f"$fake_event_id_{i}"]}),
|
||||
json_encoder.encode(
|
||||
{"prev_events": [prev_event_format(f"$fake_event_id_{i}")]}
|
||||
),
|
||||
"{}",
|
||||
)
|
||||
for i in range(500)
|
||||
@ -541,12 +559,12 @@ class EventFederationWorkerStoreTestCase(tests.unittest.HomeserverTestCase):
|
||||
# Calling prune once should return True, i.e. a prune happen. The second
|
||||
# time it shouldn't.
|
||||
pruned = self.get_success(
|
||||
self.store.prune_staged_events_in_room(room_id, RoomVersions.V6)
|
||||
self.store.prune_staged_events_in_room(room_id, room_version)
|
||||
)
|
||||
self.assertTrue(pruned)
|
||||
|
||||
pruned = self.get_success(
|
||||
self.store.prune_staged_events_in_room(room_id, RoomVersions.V6)
|
||||
self.store.prune_staged_events_in_room(room_id, room_version)
|
||||
)
|
||||
self.assertFalse(pruned)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user