From 912007ad82489f7348b71167d8db407e7dbd3825 Mon Sep 17 00:00:00 2001 From: Nick Barrett Date: Sat, 8 Oct 2022 09:37:45 +0100 Subject: [PATCH 1/5] Test complement with workers/postgres --- .github/workflows/beeper-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/beeper-ci.yml b/.github/workflows/beeper-ci.yml index 546219183361..c511d730fd88 100644 --- a/.github/workflows/beeper-ci.yml +++ b/.github/workflows/beeper-ci.yml @@ -85,6 +85,8 @@ jobs: run: ./scripts-dev/complement.sh env: COMPLEMENT_DIR: complement + WORKERS: 1 + POSTGRES: 1 # Builds From fdf14a3ee490292be42da9c04e7416db3c74689c Mon Sep 17 00:00:00 2001 From: Nick Barrett Date: Fri, 27 Jan 2023 14:23:58 +0000 Subject: [PATCH 2/5] Disable experimental complement fork starter --- docker/complement/conf/start_for_complement.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/complement/conf/start_for_complement.sh b/docker/complement/conf/start_for_complement.sh index 5560ab8b95a8..8c8f12ac92e6 100755 --- a/docker/complement/conf/start_for_complement.sh +++ b/docker/complement/conf/start_for_complement.sh @@ -69,7 +69,8 @@ if [[ -n "$SYNAPSE_COMPLEMENT_USE_WORKERS" ]]; then fi log "Workers requested: $SYNAPSE_WORKER_TYPES" # Improve startup times by using a launcher based on fork() - export SYNAPSE_USE_EXPERIMENTAL_FORKING_LAUNCHER=1 + # NOTE: does not work with Beeper changes (external_sharded_cache) + # export SYNAPSE_USE_EXPERIMENTAL_FORKING_LAUNCHER=1 else # Empty string here means 'main process only' export SYNAPSE_WORKER_TYPES="" From ef982f982ba7ea587a3f54e4099e5a994c24918b Mon Sep 17 00:00:00 2001 From: Nick Barrett Date: Fri, 3 Feb 2023 07:49:26 +0100 Subject: [PATCH 3/5] Set 2h timeout on complement Seems pretty wild and a blocker to merging, but still want to confirm it does work. --- .github/workflows/beeper-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beeper-ci.yml b/.github/workflows/beeper-ci.yml index c511d730fd88..abc88f914777 100644 --- a/.github/workflows/beeper-ci.yml +++ b/.github/workflows/beeper-ci.yml @@ -82,7 +82,7 @@ jobs: sudo apt-get install -qqy libolm3 libolm-dev go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest - name: Run Complement - run: ./scripts-dev/complement.sh + run: ./scripts-dev/complement.sh -timeout 2h env: COMPLEMENT_DIR: complement WORKERS: 1 From 94c3a9021d33b3881c7667d820d2d360e4fe4f02 Mon Sep 17 00:00:00 2001 From: Jason Little Date: Thu, 11 May 2023 04:18:07 -0500 Subject: [PATCH 4/5] Move an import to mirror how upstream does it, this allows Complement worker mode to start. --- synapse/replication/tcp/external_sharded_cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synapse/replication/tcp/external_sharded_cache.py b/synapse/replication/tcp/external_sharded_cache.py index 87f01e3d0fe2..15eba348378e 100644 --- a/synapse/replication/tcp/external_sharded_cache.py +++ b/synapse/replication/tcp/external_sharded_cache.py @@ -26,7 +26,6 @@ from synapse.logging import opentracing from synapse.logging.context import make_deferred_yieldable, run_in_background -from synapse.replication.tcp.redis import lazyConnection from synapse.util import unwrapFirstError if TYPE_CHECKING: @@ -82,6 +81,9 @@ def __init__(self, hs: "HomeServer"): self._reactor = hs.get_reactor() if hs.config.redis.redis_enabled and hs.config.redis.cache_shard_hosts: + # Only import this if we're going to use it, as it can raise an AttributeError when using the forking launcher + from synapse.replication.tcp.redis import lazyConnection + for shard in hs.config.redis.cache_shard_hosts: logger.info( "Connecting to redis (host=%r port=%r) for external cache", From 56c3a05b13b1dda0e11687b2674309ce6a89c1a0 Mon Sep 17 00:00:00 2001 From: Nick Barrett Date: Thu, 18 May 2023 20:37:59 +0100 Subject: [PATCH 5/5] Fix bad merge overriding notification priority --- synapse/push/httppusher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py index 25914340515f..8c8c221a66c5 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py @@ -431,7 +431,7 @@ async def dispatch_push_event( rejected push keys otherwise. If this array is empty, the push fully succeeded. """ - priority = "low" + priority = "high" # Beeper: always use high priority notifications if ( event.type == EventTypes.Encrypted or tweaks.get("highlight")