From b6a7d49b6f1f7c494372fd1b9aab3982c9a299c7 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 16 May 2023 08:56:42 -0500 Subject: [PATCH 1/4] `traceback.format_exception(...)` usage that is compatible with Python 3.7 and 3.11 (#15599) * Usage that is compatible with Python 3.8 and 3.11 > Since Python 3.10, instead of passing value and tb, an exception object can be passed as the first argument. If value and tb are provided, the first argument is ignored in order to provide backwards compatibility. > > -- https://docs.python.org/3/library/traceback.html * Add changelog --- changelog.d/15599.bugfix | 1 + synapse/app/_base.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/15599.bugfix diff --git a/changelog.d/15599.bugfix b/changelog.d/15599.bugfix new file mode 100644 index 0000000000..b58af8ad55 --- /dev/null +++ b/changelog.d/15599.bugfix @@ -0,0 +1 @@ +Print full error and stack-trace of any exception that occurs during startup/initialization. diff --git a/synapse/app/_base.py b/synapse/app/_base.py index 4dfcf484fa..936b1b0430 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py @@ -214,7 +214,7 @@ def handle_startup_exception(e: Exception) -> NoReturn: # the reactor are written to the logs, followed by a summary to stderr. logger.exception("Exception during startup") - error_string = "".join(traceback.format_exception(e)) + error_string = "".join(traceback.format_exception(type(e), e, e.__traceback__)) indented_error_string = indent(error_string, " ") quit_with_error( From 11ff4884e70457431ec2f816001f3772ac68a522 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Tue, 23 May 2023 10:57:39 +0100 Subject: [PATCH 2/4] 1.84.0 --- CHANGES.md | 9 +++++++++ changelog.d/15599.bugfix | 1 - debian/changelog | 6 ++++++ pyproject.toml | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) delete mode 100644 changelog.d/15599.bugfix diff --git a/CHANGES.md b/CHANGES.md index 4877ba9d44..ca594a9532 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +Synapse 1.84.0 (2023-05-23) +=========================== + +Bugfixes +-------- + +- Print full error and stack-trace of any exception that occurs during startup/initialization. ([\#15599](https://github.com/matrix-org/synapse/issues/15599)) + + Synapse 1.84.0rc1 (2023-05-16) ============================== diff --git a/changelog.d/15599.bugfix b/changelog.d/15599.bugfix deleted file mode 100644 index b58af8ad55..0000000000 --- a/changelog.d/15599.bugfix +++ /dev/null @@ -1 +0,0 @@ -Print full error and stack-trace of any exception that occurs during startup/initialization. diff --git a/debian/changelog b/debian/changelog index ad163add2b..51935e03b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +matrix-synapse-py3 (1.84.0) stable; urgency=medium + + * New Synapse release 1.84.0. + + -- Synapse Packaging team Tue, 23 May 2023 10:57:22 +0100 + matrix-synapse-py3 (1.84.0~rc1) stable; urgency=medium * New Synapse release 1.84.0rc1. diff --git a/pyproject.toml b/pyproject.toml index 86e1537a6d..9c77f9294a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ manifest-path = "rust/Cargo.toml" [tool.poetry] name = "matrix-synapse" -version = "1.84.0rc1" +version = "1.84.0" description = "Homeserver for the Matrix decentralised comms protocol" authors = ["Matrix.org Team and Contributors "] license = "Apache-2.0" From ea6fcda98d56dd8f34712de5691e77c99fc5c0ae Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Tue, 23 May 2023 11:03:06 +0100 Subject: [PATCH 3/4] Tweak changelog --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index ca594a9532..dc564d5479 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ Synapse 1.84.0 (2023-05-23) Bugfixes -------- -- Print full error and stack-trace of any exception that occurs during startup/initialization. ([\#15599](https://github.com/matrix-org/synapse/issues/15599)) +- Fix a bug introduced in Synapse 1.84.0rc1 where errors during startup were not reported correctly on Python < 3.10. ([\#15599](https://github.com/matrix-org/synapse/issues/15599)) Synapse 1.84.0rc1 (2023-05-16) From 5cae9158e67babe0553bc356802495a068222685 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Tue, 23 May 2023 11:13:38 +0100 Subject: [PATCH 4/4] Tweak changelog and upgrade notes --- CHANGES.md | 9 ++++++++- docs/upgrade.md | 23 +++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dc564d5479..e9397158f1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,8 @@ Synapse 1.84.0 (2023-05-23) =========================== +The `worker_replication_*` configuration settings have been deprecated in favour of configuring the main process consistently with other instances in the `instance_map`. The deprecated settings will be removed in Synapse v1.88.0, but changing your configuration in advance is recommended. See the [upgrade notes](https://github.com/matrix-org/synapse/blob/release-v1.84/docs/upgrade.md#upgrading-to-v1840) for more information. + Bugfixes -------- @@ -32,6 +34,12 @@ Bugfixes - Require at least poetry-core v1.1.0. ([\#15566](https://github.com/matrix-org/synapse/issues/15566), [\#15571](https://github.com/matrix-org/synapse/issues/15571)) +Deprecations and Removals +------------------------- + +- Remove need for `worker_replication_*` based settings in worker configuration yaml by placing this data directly on the `instance_map` instead. ([\#15491](https://github.com/matrix-org/synapse/issues/15491)) + + Updates to the Docker image --------------------------- @@ -51,7 +59,6 @@ Internal Changes - Use oEmbed to generate URL previews for YouTube Shorts. ([\#15025](https://github.com/matrix-org/synapse/issues/15025)) - Create new `Client` for use with HTTP Replication between workers. Contributed by Jason Little. ([\#15470](https://github.com/matrix-org/synapse/issues/15470)) -- Remove need for `worker_replication_*` based settings in worker configuration yaml by placing this data directly on the `instance_map` instead. ([\#15491](https://github.com/matrix-org/synapse/issues/15491)) - Bump pyicu from 2.10.2 to 2.11. ([\#15509](https://github.com/matrix-org/synapse/issues/15509)) - Remove references to supporting per-user flag for [MSC2654](https://github.com/matrix-org/matrix-spec-proposals/pull/2654). ([\#15522](https://github.com/matrix-org/synapse/issues/15522)) - Don't use a trusted key server when running the demo scripts. ([\#15527](https://github.com/matrix-org/synapse/issues/15527)) diff --git a/docs/upgrade.md b/docs/upgrade.md index 0625de8afb..af999dd91f 100644 --- a/docs/upgrade.md +++ b/docs/upgrade.md @@ -92,15 +92,22 @@ process, for example: ## Deprecation of `worker_replication_*` configuration settings -When using workers, +When using workers, + * `worker_replication_host` * `worker_replication_http_port` * `worker_replication_http_tls` -can now be removed from individual worker YAML configuration ***if*** you add the main process to the `instance_map` in the shared YAML configuration, -using the name `main`. +should now be removed from individual worker YAML configurations and the main process should instead be added to the `instance_map` +in the shared YAML configuration, using the name `main`. + +The old `worker_replication_*` settings are now considered deprecated and are expected to be removed in Synapse v1.88.0. + + +### Example change + +#### Before: -### Before: Shared YAML ```yaml instance_map: @@ -109,6 +116,7 @@ instance_map: port: 5678 tls: false ``` + Worker YAML ```yaml worker_app: synapse.app.generic_worker @@ -130,7 +138,10 @@ worker_listeners: worker_log_config: /etc/matrix-synapse/generic-worker-log.yaml ``` -### After: + + +#### After: + Shared YAML ```yaml instance_map: @@ -143,6 +154,7 @@ instance_map: port: 5678 tls: false ``` + Worker YAML ```yaml worker_app: synapse.app.generic_worker @@ -165,7 +177,6 @@ Notes: * `tls` is optional but mirrors the functionality of `worker_replication_http_tls` - # Upgrading to v1.81.0 ## Application service path & authentication deprecations