From 842e0390ce49328620d3ce74c681a378136afdf0 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 5 May 2022 10:08:16 +0100 Subject: [PATCH 1/5] Give some more processes log prefixes We were already running the logs for synapse *workers* through the log-prefixer, but the synapse master wasn't being prefixed, which was a bit confusing. --- docker/conf-workers/supervisord.conf.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/conf-workers/supervisord.conf.j2 b/docker/conf-workers/supervisord.conf.j2 index 408ef727879d..ca1f7aef8e3f 100644 --- a/docker/conf-workers/supervisord.conf.j2 +++ b/docker/conf-workers/supervisord.conf.j2 @@ -9,7 +9,7 @@ user=root files = /etc/supervisor/conf.d/*.conf [program:nginx] -command=/usr/sbin/nginx -g "daemon off;" +command=/usr/local/bin/prefix-log /usr/sbin/nginx -g "daemon off;" priority=500 stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 @@ -19,7 +19,7 @@ username=www-data autorestart=true [program:redis] -command=/usr/bin/redis-server /etc/redis/redis.conf --daemonize no +command=/usr/local/bin/prefix-log /usr/bin/redis-server /etc/redis/redis.conf --daemonize no priority=1 stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 @@ -29,7 +29,7 @@ username=redis autorestart=true [program:synapse_main] -command=/usr/local/bin/python -m synapse.app.homeserver --config-path="{{ main_config_path }}" --config-path=/conf/workers/shared.yaml +command=/usr/local/bin/prefix-log /usr/local/bin/python -m synapse.app.homeserver --config-path="{{ main_config_path }}" --config-path=/conf/workers/shared.yaml priority=10 # Log startup failures to supervisord's stdout/err # Regular synapse logs will still go in the configured data directory From 5fb889865b9bb1566ca6dca1d527ff6121bff047 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 5 May 2022 10:13:00 +0100 Subject: [PATCH 2/5] Bump the timeout for starting a synapse --- scripts-dev/complement.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh index e0feba05fa4f..f8edbaca9fc6 100755 --- a/scripts-dev/complement.sh +++ b/scripts-dev/complement.sh @@ -52,7 +52,11 @@ if [[ -n "$WORKERS" ]]; then COMPLEMENT_DOCKERFILE=SynapseWorkers.Dockerfile # And provide some more configuration to complement. - export COMPLEMENT_SPAWN_HS_TIMEOUT_SECS=60 + + # It can take quite a while to spin up a worker-mode Synapse for the first + # time (the main problem is that we start 14 python processes for each test, + # and complement likes to do two of them in parallel). + export COMPLEMENT_SPAWN_HS_TIMEOUT_SECS=120 else export COMPLEMENT_BASE_IMAGE=complement-synapse COMPLEMENT_DOCKERFILE=Dockerfile From 3b8d0dbcda9a9f74f42f56f0a4954306175fb832 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 5 May 2022 10:14:48 +0100 Subject: [PATCH 3/5] changelog --- changelog.d/12637.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12637.misc diff --git a/changelog.d/12637.misc b/changelog.d/12637.misc new file mode 100644 index 000000000000..735257787fed --- /dev/null +++ b/changelog.d/12637.misc @@ -0,0 +1 @@ +Minor improvements to the scripts for running Synapse in worker mode under Complement. From 72b51256e315d5ddc3444b9cec52c171f845e1ee Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 5 May 2022 10:50:01 +0100 Subject: [PATCH 4/5] Also bump the overall test timeout It takes more than 10m to run these tests. --- scripts-dev/complement.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh index f8edbaca9fc6..a3ab5a43109d 100755 --- a/scripts-dev/complement.sh +++ b/scripts-dev/complement.sh @@ -43,6 +43,8 @@ fi # Build the base Synapse image from the local checkout docker build -t matrixdotorg/synapse -f "docker/Dockerfile" . +extra_test_args=() + # If we're using workers, modify the docker files slightly. if [[ -n "$WORKERS" ]]; then # Build the workers docker image (from the base Synapse image). @@ -57,6 +59,9 @@ if [[ -n "$WORKERS" ]]; then # time (the main problem is that we start 14 python processes for each test, # and complement likes to do two of them in parallel). export COMPLEMENT_SPAWN_HS_TIMEOUT_SECS=120 + + # ... and it takes longer than 10m to run the whole suite. + extra_test_args+=("-timeout=20m") else export COMPLEMENT_BASE_IMAGE=complement-synapse COMPLEMENT_DOCKERFILE=Dockerfile @@ -68,4 +73,4 @@ docker build -t $COMPLEMENT_BASE_IMAGE -f "docker/complement/$COMPLEMENT_DOCKERF # Run the tests! echo "Images built; running complement" cd "$COMPLEMENT_DIR" -go test -v -tags synapse_blacklist,msc2716,msc3030,faster_joins -count=1 "$@" ./tests/... +go test -v -tags synapse_blacklist,msc2716,msc3030,faster_joins -count=1 "${extra_test_args[@]}" "$@" ./tests/... From f495dccc736ab7259badc73d90a86905b1cb1087 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 5 May 2022 13:57:11 +0100 Subject: [PATCH 5/5] Bump the timeout even higher --- scripts-dev/complement.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh index a3ab5a43109d..190df6909a6a 100755 --- a/scripts-dev/complement.sh +++ b/scripts-dev/complement.sh @@ -61,7 +61,7 @@ if [[ -n "$WORKERS" ]]; then export COMPLEMENT_SPAWN_HS_TIMEOUT_SECS=120 # ... and it takes longer than 10m to run the whole suite. - extra_test_args+=("-timeout=20m") + extra_test_args+=("-timeout=60m") else export COMPLEMENT_BASE_IMAGE=complement-synapse COMPLEMENT_DOCKERFILE=Dockerfile