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

Commit 1315b6a

Browse files
committed
Merge remote-tracking branch 'origin/develop' into hs/hacked-together-event-cache
2 parents 5e8c7b4 + 3186324 commit 1315b6a

File tree

5 files changed

+46
-13
lines changed

5 files changed

+46
-13
lines changed

CHANGES.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
Synapse 1.32.2 (2021-04-22)
2+
===========================
3+
4+
This release includes a fix for a regression introduced in 1.32.0.
5+
6+
Bugfixes
7+
--------
8+
9+
- 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))
10+
11+
112
Synapse 1.32.1 (2021-04-21)
213
===========================
314

415
This release fixes [a regression](https://github.com/matrix-org/synapse/issues/9853)
5-
in Synapse 1.32.0 that caused connected Prometheus instances to become unstable. If you
6-
ran Synapse 1.32.0 with Prometheus metrics, first upgrade to Synapse 1.32.1 and follow
7-
[these instructions](https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183)
8-
to clean up any excess writeahead logs.
16+
in Synapse 1.32.0 that caused connected Prometheus instances to become unstable.
17+
18+
However, as this release is still subject to the `LoggingContext` change in 1.32.0,
19+
it is recommended to remain on or downgrade to 1.31.0.
920

1021
Bugfixes
1122
--------
@@ -18,7 +29,14 @@ Synapse 1.32.0 (2021-04-20)
1829

1930
**Note:** This release introduces [a regression](https://github.com/matrix-org/synapse/issues/9853)
2031
that can overwhelm connected Prometheus instances. This issue was not present in
21-
1.32.0rc1, and is fixed in 1.32.1. See the changelog for 1.32.1 above for more information.
32+
1.32.0rc1. If affected, it is recommended to downgrade to 1.31.0 in the meantime, and
33+
follow [these instructions](https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183)
34+
to clean up any excess writeahead logs.
35+
36+
**Note:** This release also mistakenly included a change that may affected Synapse
37+
modules that import `synapse.logging.context.LoggingContext`, such as
38+
[synapse-s3-storage-provider](https://github.com/matrix-org/synapse-s3-storage-provider).
39+
This will be fixed in a later Synapse version.
2240

2341
**Note:** This release requires Python 3.6+ and Postgres 9.6+ or SQLite 3.22+.
2442

UPGRADE.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ Regression causing connected Prometheus instances to become overwhelmed
116116

117117
This release introduces `a regression <https://github.com/matrix-org/synapse/issues/9853>`_
118118
that can overwhelm connected Prometheus instances. This issue is not present in
119-
Synapse v1.32.0rc1, and is fixed in Synapse v1.32.1.
119+
Synapse v1.32.0rc1.
120120

121-
If you have been affected, please first upgrade to a more recent Synapse version.
122-
You then may need to remove excess writeahead logs in order for Prometheus to recover.
123-
Instructions for doing so are provided
121+
If you have been affected, please downgrade to 1.31.0. You then may need to
122+
remove excess writeahead logs in order for Prometheus to recover. Instructions
123+
for doing so are provided
124124
`here <https://github.com/matrix-org/synapse/pull/9854#issuecomment-823472183>`_.
125125

126126
Dropping support for old Python, Postgres and SQLite versions

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
matrix-synapse-py3 (1.32.2) stable; urgency=medium
2+
3+
* New synapse release 1.32.2.
4+
5+
-- Synapse Packaging team <[email protected]> Wed, 22 Apr 2021 12:43:52 +0100
6+
17
matrix-synapse-py3 (1.32.1) stable; urgency=medium
28

39
* New synapse release 1.32.1.

synapse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
except ImportError:
4848
pass
4949

50-
__version__ = "1.32.1"
50+
__version__ = "1.32.2"
5151

5252
if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
5353
# We import here so that we don't have to install a bunch of deps when

synapse/logging/context.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ class LoggingContext:
258258
child to the parent
259259
260260
Args:
261-
name (str): Name for the context for debugging.
261+
name: Name for the context for logging. If this is omitted, it is
262+
inherited from the parent context.
262263
parent_context (LoggingContext|None): The parent of the new context
263264
"""
264265

@@ -277,12 +278,11 @@ class LoggingContext:
277278

278279
def __init__(
279280
self,
280-
name: str,
281+
name: Optional[str] = None,
281282
parent_context: "Optional[LoggingContext]" = None,
282283
request: Optional[ContextRequest] = None,
283284
) -> None:
284285
self.previous_context = current_context()
285-
self.name = name
286286

287287
# track the resources used by this context so far
288288
self._resource_usage = ContextResourceUsage()
@@ -314,6 +314,15 @@ def __init__(
314314
# the request param overrides the request from the parent context
315315
self.request = request
316316

317+
# if we don't have a `name`, but do have a parent context, use its name.
318+
if self.parent_context and name is None:
319+
name = str(self.parent_context)
320+
if name is None:
321+
raise ValueError(
322+
"LoggingContext must be given either a name or a parent context"
323+
)
324+
self.name = name
325+
317326
def __str__(self) -> str:
318327
return self.name
319328

0 commit comments

Comments
 (0)