Commit Graph

20843 Commits

Author SHA1 Message Date
Erik Johnston
ae7858f184
Fix race when persisting an event and deleting a room (#12594)
This works by taking a row level lock on the `rooms` table at the start of both transactions, ensuring that they don't run at the same time. In the event persistence transaction we also check that there is an entry still in the `rooms` table.

I can't figure out how to do this in SQLite. I was just going to lock the table, but it seems that we don't support that in SQLite either, so I'm *really* confused as to how we maintain integrity in SQLite when using `lock_table`....
2022-05-03 11:47:21 +01:00
David Robertson
01dcf7532d
Prune mypy ignore_missing_imports list (#12608) 2022-05-03 11:03:20 +01:00
Andrew Morgan
7e6598bcf6 Move groups/communities deprecation notice to 1.58.0 heading 2022-05-03 10:54:20 +01:00
Andrew Morgan
8f5d2823df 1.58.0 2022-05-03 10:53:09 +01:00
Richard van der Hoff
8d156ec0ba
Remove special-case for twisted logger (#12589)
This was originally added when we first added a `MemoryHandler` to the default
log config back in https://github.com/matrix-org/synapse/pull/8040, to ensure
that we didn't explode with an infinite loop if there was an error formatting
the logs.

Since then, we made additional improvements to logging which make this
workaround redundant. In particular:

 * we no longer attempt to log un-UTF8-decodable byte sequences, which were the
   most likely cause of an error in the first place.

 * https://github.com/matrix-org/synapse/pull/8268 ensures that in the unlikely
   case that there *is* an error, it won't cause an infinite loop.
2022-04-29 22:05:18 +01:00
David Robertson
57fac2a234
Allow unused ignores in "bleeding edge" CI (#12576)
* Allow unused ignores in "bleeding edge" CI

Where "bleeding edge" means the Twisted Trunk and Latest Deps jobs.

Follow up from #12531.
Resolves #12574.

* Use `--extras all` in latest deps mypy CI

Twisted trunk job already does this.

Missed in #12531.

* changelog
2022-04-29 17:57:23 +01:00
Patrick Cloke
3ae56d125c
Improve the docstrings for the receipts store. (#12581) 2022-04-28 17:58:58 +00:00
Šimon Brandner
0d9eaa19fd Use constants for receipt types in tests. (#12582) 2022-04-28 13:34:33 -04:00
Sean Quah
0b684b59e5
Fix logging of incorrect status codes for disconnected requests (#12580)
The status code of requests must always be set, regardless of client
disconnection, otherwise they will always be logged as 200!.

Broken for `respond_with_json` in
f48792eec4.
Broken for `respond_with_json_bytes` in
3e58ce72b4.
Broken for `respond_with_html_bytes` in
ea26e9a98b.

Signed-off-by: Sean Quah <seanq@element.io>
2022-04-28 15:49:50 +00:00
DeepBlueV7.X
629aa51743
Add linebreak to pipx install quote in README (#12579) 2022-04-28 13:54:46 +01:00
David Robertson
5d3509dfda
Revert accidental direct-to-develop commits.
This reverts commit 5a320baa45.
This reverts commit f282d5fc11.
This reverts commit ce6ecdd4b4.
2022-04-28 11:33:05 +01:00
David Robertson
5a320baa45
changelog 2022-04-28 11:31:26 +01:00
David Robertson
f282d5fc11
Use --extras all in latest deps mypy CI
Twisted trunk job already does this.

Missed in #12531.
2022-04-28 11:29:13 +01:00
David Robertson
ce6ecdd4b4
Allow unused ignores in "bleeding edge" CI
Where "bleeding edge" means the Twisted Trunk and Latest Deps jobs.

Follow up from #12531.
Resolves #12574.
2022-04-28 11:28:22 +01:00
Sean Quah
78b99de7c2
Prefer make_awaitable over defer.succeed in tests (#12505)
When configuring the return values of mocks, prefer awaitables from
`make_awaitable` over `defer.succeed`. `Deferred`s are only awaitable
once, so it is inappropriate for a mock to return the same `Deferred`
multiple times.

Also update `run_in_background` to support functions that return
arbitrary awaitables.

Signed-off-by: Sean Quah <seanq@element.io>
2022-04-27 14:58:26 +01:00
Brendan Abolivier
5ef673de4f
Add a module API to allow modules to edit push rule actions (#12406)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2022-04-27 13:55:33 +00:00
reivilibre
d743b25c8f
Use supervisord to supervise Postgres and Caddy in the Complement image. (#12480)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2022-04-27 14:39:41 +01:00
David Robertson
30c8e7e408
Make scripts-dev pass mypy --disallow-untyped-defs (#12356)
Not enforced in config yet. One day.
2022-04-27 13:10:31 +00:00
David Robertson
6463244375
Remove unused # type: ignores (#12531)
Over time we've begun to use newer versions of mypy, typeshed, stub
packages---and of course we've improved our own annotations. This makes
some type ignore comments no longer necessary. I have removed them.

There was one exception: a module that imports `select.epoll`. The
ignore is redundant on Linux, but I've kept it ignored for those of us
who work on the source tree using not-Linux. (#11771)

I'm more interested in the config line which enforces this. I want
unused ignores to be reported, because I think it's useful feedback when
annotating to know when you've fixed a problem you had to previously
ignore.

* Installing extras before typechecking

Lacking an easy way to install all extras generically, let's bite the bullet and
make install the hand-maintained `all` extra before typechecking.

Now that https://github.com/matrix-org/backend-meta/pull/6 is merged to
the release/v1 branch.
2022-04-27 14:03:44 +01:00
Patrick Cloke
8a23bde823
Consistently use collections.abc.Mapping to check frozendict. (#12564) 2022-04-27 09:00:07 -04:00
Will Hunt
e8d1ec0e92
Add option to enable token registration without requiring 3pids (#12526) 2022-04-27 12:57:53 +00:00
Dirk Klimpel
b76f1a4d5f
Add some type hints to datastore (#12485) 2022-04-27 13:05:00 +01:00
Nick Mills-Barrett
63ba9ba38b
Bound ephemeral events by key (#12544)
Co-authored-by: Brad Murray <bradtgmurray@gmail.com>
Co-authored-by: Andrew Morgan <andrewm@element.io>
2022-04-26 20:14:21 +01:00
David Robertson
9986621bc8 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](https://github.com/matrix-org/synapse/issues/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](https://github.com/matrix-org/synapse/issues/12555))
 
 Internal Changes
 ----------------
 
 - Reduce unnecessary work when handling remote device list updates. ([\#12557](https://github.com/matrix-org/synapse/issues/12557))
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE1508oLYUKainYFJakD7OEIo53t0FAmJoINsACgkQkD7OEIo5
 3t0ETA//VANpmz0ykLeBA0XRW0eifQkHnQyBoZQtXL+I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sCqJYFTP4yvdc6iScFALyxXn
 QNGTZlctuNbR/v6WVQbiFtSyF1GnLos1+7jpEBpGRUk30H68zOwsi+qLZh9r98mB
 vQ0G2HA/klzdnIvq9DxWLL0PxQZKocdu5CT2ujV+6J7vkKAXmC/0rkDRWdi2qooU
 uRb3CbAHo4A6GnoqsrhY1i1JuUNbX7Nu2BZsLaiIdp2JTt6OzS/0zfUgCZzPw0u0
 1586SlmiSdtXNMOlgpHPVtD71CCq/48tbccsomI1hk5dmiqlZX4hqsHSQY97k422
 NV9LNpPo0K5l2Qmegera94Qz0FzCv4TCSDEAXn//lHCZ6eAVARk6Wym0UCOXToqw
 Xg1igJEkGOkIcwXj6GpG+r8yMdYD52xG6Ud8ZbYTX1glDfVWN4U=
 =YYmi
 -----END PGP SIGNATURE-----

Merge tag 'v1.58.0rc2' into develop

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](https://github.com/matrix-org/synapse/issues/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](https://github.com/matrix-org/synapse/issues/12555))

Internal Changes
----------------

- Reduce unnecessary work when handling remote device list updates. ([\#12557](https://github.com/matrix-org/synapse/issues/12557))
2022-04-26 18:07:15 +01:00
David Robertson
9cfecd2dc0
Adjust changelog 2022-04-26 17:22:12 +01:00
David Robertson
56c9c6c465
Credit Tulir's contribution in 1.58.0rc1 to Beeper, too 2022-04-26 17:17:56 +01:00
David Robertson
6b64ee9ec7
1.58.0rc2 2022-04-26 17:16:43 +01:00
Erik Johnston
f59e3f4c90
Mark remote device list updates as already handled (#12557) 2022-04-26 17:07:21 +01:00
David Robertson
6d89f1239c
Comment out dodgy log-kv (#12554) 2022-04-26 15:53:06 +01:00
Erik Johnston
c48ab3734e
Fix sending opentracing contexts to remote servers (#12555) 2022-04-26 14:48:16 +00:00
Jason Robinson
706456de1f
Mark Dockerfile as requiring BuildKit (#12541)
Co-authored-by: David Robertson <davidr@element.io>
2022-04-26 15:31:52 +01:00
David Robertson
ee1601e59d
Unbold deprecation: it is mentioned at the top 2022-04-26 11:59:10 +01:00
David Robertson
6b9e95015b
Lint the release script 2022-04-26 11:53:37 +01:00
David Robertson
416604e3bc
Another set of changelog updates 2022-04-26 11:51:47 +01:00
David Robertson
a54d9b0508
We don't require redbaron in the release script 2022-04-26 11:37:21 +01:00
David Robertson
f987cdd80b
Changelog update 2022-04-26 11:32:57 +01:00
David Robertson
30db7fdb91
1.58.0rc1 2022-04-26 11:15:33 +01:00
David Robertson
7c063da25c
Temporarily lower debian changelog version number
This seems to make dch happy when we prepare the release.
2022-04-26 11:14:41 +01:00
David Robertson
730fcda546
Update release script to be poetry-aware
Poetry now manages the project version in pyproject.toml.
2022-04-26 11:14:27 +01:00
Shay
99ab45423a
build debian package for jammy jellyfish (#12543) 2022-04-26 10:34:59 +01:00
Richard van der Hoff
17d99f758a
Optimise backfill calculation (#12522)
Try to avoid an OOM by checking fewer extremities.

Generally this is a big rewrite of _maybe_backfill, to try and fix some of the TODOs and other problems in it. It's best reviewed commit-by-commit.
2022-04-26 10:27:11 +01:00
Shay
e75c7e3b6d
Add a table of contents to config manual (#12527)
* Update config_documentation.md
2022-04-25 11:43:59 -07:00
Sean Quah
8a87b4435a
Handle cancellation in EventsWorkerStore._get_events_from_cache_or_db (#12529)
Multiple calls to `EventsWorkerStore._get_events_from_cache_or_db` can
reuse the same database fetch, which is initiated by the first call.
Ensure that cancelling the first call doesn't cancel the other calls
sharing the same database fetch.

Signed-off-by: Sean Quah <seanq@element.io>
2022-04-25 19:39:17 +01:00
Sami Olmari
813d728d09
Correct typo in user_admin_api.md device deletion JSON (#12533)
Signed-off-by: Sami Olmari <sami@olmari.fi>
2022-04-25 12:39:15 +00:00
David Robertson
8bac3e0435
disallow-untyped-defs in docker and stubs directories (#12528) 2022-04-25 12:32:35 +00:00
Patrick Cloke
185da8f0f2
Misc. clean-ups to the relations code (#12519)
* Corrects some typos / copy & paste errors in tests.
* Clarifies docstrings.
* Removes an unnecessary method.
2022-04-25 08:25:56 -04:00
villepeh
d9b71410c2
Add HAProxy delegation example to docs (#12501)
Signed-off-by: Ville Petteri Huh
2022-04-25 13:18:18 +01:00
Dirk Klimpel
a36a38b1ca
Add some example configurations for worker (#12492)
Signed-off-by: Dirk Klimpel <dirk@klimpel.org>
2022-04-25 13:17:03 +01:00
Sean Quah
a50fb411b3
Update delay_cancellation to accept any awaitable (#12468)
This will mainly be useful when dealing with module callbacks, which are
all typed as returning `Awaitable`s instead of coroutines or
`Deferred`s.

Signed-off-by: Sean Quah <seanq@element.io>
2022-04-22 18:20:06 +01:00
Will Hunt
b82fff66df
MSC3202: Fix device_unused_fallback_keys -> device_unused_fallback_key_types (#12520)
* Fix device_unused_fallback_keys -> device_unused_fallback_key_types

* changelog
2022-04-22 16:03:46 +01:00