From 84446e52e983f9cf1a1441f980d55773406b0a8c Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 20 Jan 2024 12:39:20 +0200 Subject: [PATCH] Rename Synapse worker preset name (room-workers -> specialized-workers) I believe `specialized-workers` is a better name than `room-workers`, because when enabled, 4 different types of specialized workers are created: - Room workers - Sync workers - Client readers - Federation readers Only one of these is called room-workers. In the future, more specialized workers may be added, making the `room-workers` preset name an even poorer choice. Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3100 --- roles/custom/matrix-synapse/defaults/main.yml | 2 +- roles/custom/matrix-synapse/tasks/init.yml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index 84bc9ff8a..ac382622b 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -706,7 +706,7 @@ matrix_synapse_workers_presets: stream_writer_account_data_stream_workers_count: 1 stream_writer_receipts_stream_workers_count: 1 stream_writer_presence_stream_workers_count: 1 - room-workers: + specialized-workers: room_workers_count: 1 sync_workers_count: 1 client_reader_workers_count: 1 diff --git a/roles/custom/matrix-synapse/tasks/init.yml b/roles/custom/matrix-synapse/tasks/init.yml index 234eb78e5..341350a49 100644 --- a/roles/custom/matrix-synapse/tasks/init.yml +++ b/roles/custom/matrix-synapse/tasks/init.yml @@ -1,5 +1,16 @@ --- +# This validation task is here, not in validate_config.yml, +# because init.yml runs before it. +# +# validate_config.yml aims to validate the configuration based on the work we do, +# so we can't change the order. +- name: Fail when using the old (renamed) room-workers preset + ansible.builtin.fail: + msg: >- + The `room-workers` preset has been renamed to `specialized-workers`. Update your `matrix_synapse_workers_preset` variable to use the new name. + when: matrix_synapse_workers_preset == 'room-workers' + # Unless `matrix_synapse_workers_enabled_list` is explicitly defined, # we'll generate it dynamically. - ansible.builtin.include_tasks: "{{ role_path }}/tasks/synapse/workers/init.yml"