From 2c52f9820e9b9c2b9daf5674fff2e1dcf9121b1b Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 14 Oct 2026 08:47:40 -0500 Subject: [PATCH 1/2] Constrain `txredisapi` version to avoid incompatible breaking changes in `txredisapi@1.6.0` (#20354) Fix https://github.com/element-hq/synapse/issues/20347 See https://github.com/element-hq/synapse/issues/20347#issuecomment-6154861014 for more details. Caused by the latest release of `txredisapi@1.6.0` (2026-10-09) which included https://github.com/IlyaSkriblovsky/txredisapi/pull/162 > May break compatibility with some specific user code because of inheritance changes. And in the changelog: > ### Incompatible changes > > - Connections are maintained by > `twisted.application.internet.ClientService` now, and `RedisFactory` is no > longer a `ReconnectingClientFactory`. Code connecting a factory on its own > with `reactor.connectTCP()` or `twisted.application.internet.TCPClient` has > to use `factory.startConnecting(endpoint)` instead - see `examples/subscriber.py` > > - `factory.continueTrying = False` is replaced by `factory.stopTrying()`; > `retry()`, `resetDelay()` and `delay` are gone. `maxDelay`, `initialDelay`, > `factor` and `jitter` still configure the backoff and are used by the new > `RedisFactory.retryDelay()` > > - `SentinelConnectionFactory.try_to_connect()` is gone: the address of the > master or of a slave is discovered by the endpoint before every attempt. > Subclasses overriding `try_to_connect()`, `clientConnectionFailed()` or > `clientConnectionLost()` have no effect anymore > > [...] > > *-- [`IlyaSkriblovsky/txredisapi` -> *Release 1.6.0 (2026-10-09)*](https://github.com/IlyaSkriblovsky/txredisapi/blob/f844759b8aabc689eb87bf300ed3c675b84c3608/CHANGELOG.md#L31-L35)* ### Testing strategy 1. Check out the PR: `git checkout madlittlemods/20347-txredisapi-constraint` 1. Install into a fresh scratch venv: ```shell rm -rf /tmp/venv && python3 -m venv /tmp/venv /tmp/venv/bin/pip install '.[all]' /tmp/venv/bin/pip show txredisapi | grep Version # expect 1.5.0 with this PR ``` 1. One-time setup: make a homeserver config with Redis enabled: ```shell mkdir -p /tmp/hs && cd /tmp/hs /tmp/venv/bin/python -m synapse.app.homeserver --server-name repro.test \ -c homeserver.yaml --generate-config --report-stats=no printf '\nredis:\n enabled: true\n host: localhost\n' >> homeserver.yaml cd - ``` - On my machine, I also have to remove the IPv6 bind for `::1`, so `sed -i '/^ - ::1$/d' /tmp/hs/homeserver.yaml` 1. Run Synapse: `/tmp/venv/bin/python -P -m synapse.app.homeserver -c /tmp/hs/homeserver.yaml` - It should run successfully with this PR. You can also check `/tmp/hs/homeserver.log` for logs. Repeat these steps on `develop` to see the original failure described in https://github.com/element-hq/synapse/issues/20347 (`AttributeError: 'super' object has no attribute 'startedConnecting'. Did you mean: 'startConnecting'?`) --- changelog.d/20354.bugfix | 1 + poetry.lock | 4 ++-- pyproject.toml | 19 +++++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 changelog.d/20354.bugfix diff --git a/changelog.d/20354.bugfix b/changelog.d/20354.bugfix new file mode 100644 index 0000000000..6777f2f9ae --- /dev/null +++ b/changelog.d/20354.bugfix @@ -0,0 +1 @@ +Fix Synapse failing to start with Redis enabled when installed using pip (avoid incompatible breaking changes in `txredisapi@1.6.0`). diff --git a/poetry.lock b/poetry.lock index a19babbcd9..2649e2450d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1972,7 +1972,7 @@ files = [ {file = "pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992"}, {file = "pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29"}, ] -markers = {main = "implementation_name != \"PyPy\"", dev = "platform_python_implementation != \"PyPy\" and implementation_name != \"PyPy\""} +markers = {main = "implementation_name != \"PyPy\"", dev = "implementation_name != \"PyPy\" and platform_python_implementation != \"PyPy\""} [[package]] name = "pydantic" @@ -3661,4 +3661,4 @@ url-preview = ["beautifulsoup4"] [metadata] lock-version = "2.1" python-versions = ">=3.10.0,<4.0.0" -content-hash = "b8ee2c063150549de2946f70cd557c427e16a9101052915ef23eb6dd9d8f77eb" +content-hash = "6e8f0d223b61ab7c100236797f0ec1eed7f23b819c01c117fe445c6b1e91bbfc" diff --git a/pyproject.toml b/pyproject.toml index 4ad1c8d4f2..5f7f66e978 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,11 +152,18 @@ opentracing = [ "tornado>=6.0", # via jaeger-client ] jwt = ["authlib"] -# hiredis is not a *strict* dependency, but it makes things much faster. -# (if it is not installed, we fall back to slow code.) -# txredisapi 1.4.12 is the first release to accept a `username` kwarg for -# Redis ACL auth: https://github.com/IlyaSkriblovsky/txredisapi/releases/tag/1.4.12 -redis = ["txredisapi>=1.4.12", "hiredis>=0.3"] +redis = [ + # txredisapi 1.4.12 is the first release to accept a `username` kwarg for + # Redis ACL auth: https://github.com/IlyaSkriblovsky/txredisapi/releases/tag/1.4.12 + # + # FIXME: 1.6.0 introduces a number of incompatible breaking changes that will + # require updates to our own code, see + # https://github.com/element-hq/synapse/issues/20347#issuecomment-6154861014 + "txredisapi>=1.4.12,<1.6.0", + # hiredis is not a *strict* dependency, but it makes things much faster. + # (if it is not installed, we fall back to slow code.) + "hiredis>=0.3" +] # Required to use experimental `caches.track_memory_usage` config option. cache-memory = ["pympler>=1.0"] # If this is updated, don't forget to update the equivalent lines in @@ -190,7 +197,7 @@ all = [ # opentracing "jaeger-client>=4.2.0", "opentracing>=2.2.0", # redis - "txredisapi>=1.4.12", "hiredis>=0.3", + "txredisapi>=1.4.12,<1.6.0", "hiredis>=0.3", # cache-memory # 1.0 added support for python 3.10, our current minimum supported python version "pympler>=1.0", From 193cf9466fbfbe334700c541dc1442f135179aaf Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 14 Oct 2026 09:22:00 -0500 Subject: [PATCH 2/2] 1.163.0 --- CHANGES.md | 9 +++++++++ changelog.d/20354.bugfix | 1 - debian/changelog | 6 ++++++ pyproject.toml | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) delete mode 100644 changelog.d/20354.bugfix diff --git a/CHANGES.md b/CHANGES.md index 1730966a5e..f4f498ea93 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,12 @@ +# Synapse 1.163.0 (2026-10-14) + +## Bugfixes + +- Fix Synapse failing to start with Redis enabled when installed using pip (avoid incompatible breaking changes in `txredisapi@1.6.0`). ([\#20354](https://github.com/element-hq/synapse/issues/20354)) + + + + # Synapse 1.163.0rc1 (2026-10-06) ## Features diff --git a/changelog.d/20354.bugfix b/changelog.d/20354.bugfix deleted file mode 100644 index 6777f2f9ae..0000000000 --- a/changelog.d/20354.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix Synapse failing to start with Redis enabled when installed using pip (avoid incompatible breaking changes in `txredisapi@1.6.0`). diff --git a/debian/changelog b/debian/changelog index b4247c5d4f..0552032bce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +matrix-synapse-py3 (1.163.0) stable; urgency=medium + + * New synapse release 1.163.0. + + -- Synapse Packaging team Wed, 14 Oct 2026 14:20:13 +0000 + matrix-synapse-py3 (1.163.0~rc1) stable; urgency=medium * New synapse release 1.163.0rc1. diff --git a/pyproject.toml b/pyproject.toml index 5f7f66e978..bbb27a8507 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "matrix-synapse" -version = "1.163.0rc1" +version = "1.163.0" description = "Homeserver for the Matrix decentralised comms protocol" readme = "README.rst" authors = [