Merge remote-tracking branch 'upstream/release-v1.32.2'

This commit is contained in:
Tulir Asokan 2021-04-22 13:16:07 +03:00
commit ecf2ada39c
5 changed files with 46 additions and 13 deletions

View file

@ -1,11 +1,22 @@
Synapse 1.32.2 (2021-04-22)
===========================
This release includes a fix for a regression introduced in 1.32.0.
Bugfixes
--------
- Fix a regression in Synapse 1.32.0 and 1.32.1 which caused `LoggingContext` errors in plugins. ([\#9857](https://github.com/matrix-org/synapse/issues/9857))
Synapse 1.32.1 (2021-04-21) Synapse 1.32.1 (2021-04-21)
=========================== ===========================
This release fixes [a regression](https://github.com/matrix-org/synapse/issues/9853) This release fixes [a regression](https://github.com/matrix-org/synapse/issues/9853)
in Synapse 1.32.0 that caused connected Prometheus instances to become unstable. If you in Synapse 1.32.0 that caused connected Prometheus instances to become unstable.
ran Synapse 1.32.0 with Prometheus metrics, first upgrade to Synapse 1.32.1 and follow
[these instructions](https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183) However, as this release is still subject to the `LoggingContext` change in 1.32.0,
to clean up any excess writeahead logs. it is recommended to remain on or downgrade to 1.31.0.
Bugfixes Bugfixes
-------- --------
@ -18,7 +29,14 @@ Synapse 1.32.0 (2021-04-20)
**Note:** This release introduces [a regression](https://github.com/matrix-org/synapse/issues/9853) **Note:** This release introduces [a regression](https://github.com/matrix-org/synapse/issues/9853)
that can overwhelm connected Prometheus instances. This issue was not present in that can overwhelm connected Prometheus instances. This issue was not present in
1.32.0rc1, and is fixed in 1.32.1. See the changelog for 1.32.1 above for more information. 1.32.0rc1. If affected, it is recommended to downgrade to 1.31.0 in the meantime, and
follow [these instructions](https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183)
to clean up any excess writeahead logs.
**Note:** This release also mistakenly included a change that may affected Synapse
modules that import `synapse.logging.context.LoggingContext`, such as
[synapse-s3-storage-provider](https://github.com/matrix-org/synapse-s3-storage-provider).
This will be fixed in a later Synapse version.
**Note:** This release requires Python 3.6+ and Postgres 9.6+ or SQLite 3.22+. **Note:** This release requires Python 3.6+ and Postgres 9.6+ or SQLite 3.22+.

View file

@ -93,11 +93,11 @@ Regression causing connected Prometheus instances to become overwhelmed
This release introduces `a regression <https://github.com/matrix-org/synapse/issues/9853>`_ This release introduces `a regression <https://github.com/matrix-org/synapse/issues/9853>`_
that can overwhelm connected Prometheus instances. This issue is not present in that can overwhelm connected Prometheus instances. This issue is not present in
Synapse v1.32.0rc1, and is fixed in Synapse v1.32.1. Synapse v1.32.0rc1.
If you have been affected, please first upgrade to a more recent Synapse version. If you have been affected, please downgrade to 1.31.0. You then may need to
You then may need to remove excess writeahead logs in order for Prometheus to recover. remove excess writeahead logs in order for Prometheus to recover. Instructions
Instructions for doing so are provided for doing so are provided
`here <https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183>`_. `here <https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183>`_.
Dropping support for old Python, Postgres and SQLite versions Dropping support for old Python, Postgres and SQLite versions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
matrix-synapse-py3 (1.32.2) stable; urgency=medium
* New synapse release 1.32.2.
-- Synapse Packaging team <packages@matrix.org> Wed, 22 Apr 2021 12:43:52 +0100
matrix-synapse-py3 (1.32.1) stable; urgency=medium matrix-synapse-py3 (1.32.1) stable; urgency=medium
* New synapse release 1.32.1. * New synapse release 1.32.1.

View file

@ -48,7 +48,7 @@ try:
except ImportError: except ImportError:
pass pass
__version__ = "1.32.1" __version__ = "1.32.2"
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

View file

@ -258,7 +258,8 @@ class LoggingContext:
child to the parent child to the parent
Args: Args:
name (str): Name for the context for debugging. name: Name for the context for logging. If this is omitted, it is
inherited from the parent context.
parent_context (LoggingContext|None): The parent of the new context parent_context (LoggingContext|None): The parent of the new context
""" """
@ -277,12 +278,11 @@ class LoggingContext:
def __init__( def __init__(
self, self,
name: str, name: Optional[str] = None,
parent_context: "Optional[LoggingContext]" = None, parent_context: "Optional[LoggingContext]" = None,
request: Optional[ContextRequest] = None, request: Optional[ContextRequest] = None,
) -> None: ) -> None:
self.previous_context = current_context() self.previous_context = current_context()
self.name = name
# track the resources used by this context so far # track the resources used by this context so far
self._resource_usage = ContextResourceUsage() self._resource_usage = ContextResourceUsage()
@ -314,6 +314,15 @@ class LoggingContext:
# the request param overrides the request from the parent context # the request param overrides the request from the parent context
self.request = request self.request = request
# if we don't have a `name`, but do have a parent context, use its name.
if self.parent_context and name is None:
name = str(self.parent_context)
if name is None:
raise ValueError(
"LoggingContext must be given either a name or a parent context"
)
self.name = name
def __str__(self) -> str: def __str__(self) -> str:
return self.name return self.name