From b84f9d89e7b0d5e2fa1cd42e9cb36465aedf45b5 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Fri, 17 Dec 2021 09:47:16 -0500 Subject: [PATCH 01/19] Add documentation for missing worker types. --- docs/workers.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index fd83e2ddeb1f..4af4614b91f2 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -238,12 +238,16 @@ expressions: ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$ ^/_matrix/client/(api/v1|r0|v3|unstable)/search$ + # Encryption requests + ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/claim + ^/_matrix/client/(api/v1|r0|v3|unstable)/room_keys + # Registration/login requests ^/_matrix/client/(api/v1|r0|v3|unstable)/login$ ^/_matrix/client/(r0|v3|unstable)/register$ ^/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity$ - # Event sending requests + # Event sending requests (for the event stream writer) ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/ @@ -251,6 +255,20 @@ expressions: ^/_matrix/client/(api/v1|r0|v3|unstable)/join/ ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/ + # Typing requests (for the typing stream writer) + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing + + # Device requests (for the to_device stream writer) + ^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/ + + # Account data requests (for the account_data stream writer) + ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags + ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/account_data + + # Receipts requests (for the receipts stream writer) + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers + Additionally, the following REST endpoints can be handled for GET requests: @@ -330,7 +348,13 @@ Additionally, there is *experimental* support for moving writing of specific streams (such as events) off of the main process to a particular worker. (This is only supported with Redis-based replication.) -Currently supported streams are `events` and `typing`. +Currently supported streams are: + +* `events` +* `typing` +* `to_device` +* `account_data` +* `receipts` To enable this, the worker must have a HTTP replication listener configured, have a `worker_name` and be listed in the `instance_map` config. For example to From 2945710c0feaed096b1fead2de7ba4b9a08e3ebd Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Fri, 17 Dec 2021 09:47:33 -0500 Subject: [PATCH 02/19] Try to clarify how to route to workers. --- docs/workers.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 4af4614b91f2..1534e375061b 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -178,8 +178,11 @@ recommend the use of `systemd` where available: for information on setting up ### `synapse.app.generic_worker` -This worker can handle API requests matching the following regular -expressions: +This worker can handle API requests matching the following regular expressions. + +Note that stream writers should have their endpoints routed directly to them for +efficiency. If this is not done, the requests will be proxied to the proper +worker. # Sync requests ^/_matrix/client/(v2_alpha|r0|v3)/sync$ @@ -357,9 +360,9 @@ Currently supported streams are: * `receipts` To enable this, the worker must have a HTTP replication listener configured, -have a `worker_name` and be listed in the `instance_map` config. For example to -move event persistence off to a dedicated worker, the shared configuration would -include: +have a `worker_name` and be listed in the `instance_map` config. The same worker +can handle multiple streams. For example, to move event persistence off to a +dedicated worker, the shared configuration would include: ```yaml instance_map: @@ -383,6 +386,9 @@ stream_writers: - event_persister2 ``` +Each of the streams have associated endpoints which should be routed to the worker +see the end regular expression map above to properly route requests. + #### Background tasks There is also *experimental* support for moving background tasks to a separate From 71a5001cc54be30e62d6e7addcb087124db57068 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Fri, 17 Dec 2021 09:57:10 -0500 Subject: [PATCH 03/19] Document presence worker. --- docs/workers.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/workers.md b/docs/workers.md index 1534e375061b..9349e9933d45 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -272,6 +272,9 @@ worker. ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers + # Presence requests (for the presence stream writer) + ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/.*/status$ + Additionally, the following REST endpoints can be handled for GET requests: @@ -358,6 +361,7 @@ Currently supported streams are: * `to_device` * `account_data` * `receipts` +* `presence` To enable this, the worker must have a HTTP replication listener configured, have a `worker_name` and be listed in the `instance_map` config. The same worker From 5ad39a41c6604753057206c431242d57d7a6d1ec Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Fri, 17 Dec 2021 10:10:46 -0500 Subject: [PATCH 04/19] Newsfragment --- changelog.d/11599.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/11599.doc diff --git a/changelog.d/11599.doc b/changelog.d/11599.doc new file mode 100644 index 000000000000..f07cfbef4e4c --- /dev/null +++ b/changelog.d/11599.doc @@ -0,0 +1 @@ +Document support for the `to_device`, `account_data`, `receipts`, and `presence` stream writers for workers. From 55365e00b4977e27f41fc2866dc2868444af29ae Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Mon, 20 Dec 2021 15:28:09 -0500 Subject: [PATCH 05/19] Clarify GET vs. PUT/POST requests. --- docs/workers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 9349e9933d45..871ae26a8c73 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -181,8 +181,8 @@ recommend the use of `systemd` where available: for information on setting up This worker can handle API requests matching the following regular expressions. Note that stream writers should have their endpoints routed directly to them for -efficiency. If this is not done, the requests will be proxied to the proper -worker. +efficiency. If this is not done, then `POST` and `PUT` requests will be proxied +to the proper worker while `GET` requests will be handled directly. # Sync requests ^/_matrix/client/(v2_alpha|r0|v3)/sync$ From 5a8b3856e239f53f2cf9a449ae6e009240800ead Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 28 Dec 2021 13:30:38 -0500 Subject: [PATCH 06/19] Rework the endpoints for stream writers. --- docs/workers.md | 85 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 21 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 871ae26a8c73..a848aa17b016 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -179,10 +179,9 @@ recommend the use of `systemd` where available: for information on setting up ### `synapse.app.generic_worker` This worker can handle API requests matching the following regular expressions. - -Note that stream writers should have their endpoints routed directly to them for -efficiency. If this is not done, then `POST` and `PUT` requests will be proxied -to the proper worker while `GET` requests will be handled directly. +`GET` requests will be handled directly while `POST` and `PUT` requests will be +proxied to the proper worker. See the [stream writers](#stream-writers) section +below for more information. # Sync requests ^/_matrix/client/(v2_alpha|r0|v3)/sync$ @@ -250,7 +249,7 @@ to the proper worker while `GET` requests will be handled directly. ^/_matrix/client/(r0|v3|unstable)/register$ ^/_matrix/client/unstable/org.matrix.msc3231/register/org.matrix.msc3231.login.registration_token/validity$ - # Event sending requests (for the event stream writer) + # Event sending requests ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/ @@ -258,21 +257,21 @@ to the proper worker while `GET` requests will be handled directly. ^/_matrix/client/(api/v1|r0|v3|unstable)/join/ ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/ - # Typing requests (for the typing stream writer) + # Typing requests ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing - # Device requests (for the to_device stream writer) + # Device requests ^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/ - # Account data requests (for the account_data stream writer) + # Account data requests ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/account_data - # Receipts requests (for the receipts stream writer) + # Receipts requests ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers - # Presence requests (for the presence stream writer) + # Presence requests ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/.*/status$ @@ -354,15 +353,6 @@ Additionally, there is *experimental* support for moving writing of specific streams (such as events) off of the main process to a particular worker. (This is only supported with Redis-based replication.) -Currently supported streams are: - -* `events` -* `typing` -* `to_device` -* `account_data` -* `receipts` -* `presence` - To enable this, the worker must have a HTTP replication listener configured, have a `worker_name` and be listed in the `instance_map` config. The same worker can handle multiple streams. For example, to move event persistence off to a @@ -378,6 +368,25 @@ stream_writers: events: event_persister1 ``` +Each of the streams have associated endpoints which should have `POST` and `PUT` +requests routed to the workers handling that stream. Otherwise, those requests +will be proxied to the proper worker. + +See below for the currently supported streams and the endpoints associated with +them: + +##### The `events` stream + +The following endpoints should be routed direclty to the workers configured as +stream writers for the `events` stream: + + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/ + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$ + ^/_matrix/client/(api/v1|r0|v3|unstable)/join/ + ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/ + The `events` stream also experimentally supports having multiple writers, where work is sharded between them by room ID. Note that you *must* restart all worker instances when adding or removing event persisters. An example `stream_writers` @@ -390,8 +399,42 @@ stream_writers: - event_persister2 ``` -Each of the streams have associated endpoints which should be routed to the worker -see the end regular expression map above to properly route requests. +##### The `typing` stream + +The following endpoints should be routed direclty to the workers configured as +stream writers for the `typing` stream: + + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing + +##### The `to_device` stream + +The following endpoints should be routed direclty to the workers configured as +stream writers for the `to_device` stream: + + ^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/ + +##### The `account_data` stream + +The following endpoints should be routed direclty to the workers configured as +stream writers for the `account_data` stream: + + ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags + ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/account_data + +##### The `receipts` stream + +The following endpoints should be routed direclty to the workers configured as +stream writers for the `receipts` stream: + + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt + ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers + +##### The `presence` stream + +The following endpoints should be routed direclty to the workers configured as +stream writers for the `presence` stream: + + ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/.*/status$ #### Background tasks From 4aab90ef35898ab04da5c886fc261fd227c6bf62 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 6 Jan 2022 13:38:29 -0500 Subject: [PATCH 07/19] Fix typos. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- docs/workers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index a848aa17b016..6b5cbc3d74be 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -181,7 +181,7 @@ recommend the use of `systemd` where available: for information on setting up This worker can handle API requests matching the following regular expressions. `GET` requests will be handled directly while `POST` and `PUT` requests will be proxied to the proper worker. See the [stream writers](#stream-writers) section -below for more information. +below for more information. # Sync requests ^/_matrix/client/(v2_alpha|r0|v3)/sync$ @@ -401,7 +401,7 @@ stream_writers: ##### The `typing` stream -The following endpoints should be routed direclty to the workers configured as +The following endpoints should be routed directly to the workers configured as stream writers for the `typing` stream: ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing From 1dfd36468ff6aa13464a227e4983cfbcfbaac819 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 6 Jan 2022 13:39:21 -0500 Subject: [PATCH 08/19] Fix more typos. --- docs/workers.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 6b5cbc3d74be..21653194ac21 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -377,7 +377,7 @@ them: ##### The `events` stream -The following endpoints should be routed direclty to the workers configured as +The following endpoints should be routed directly to the workers configured as stream writers for the `events` stream: ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact @@ -408,14 +408,14 @@ stream writers for the `typing` stream: ##### The `to_device` stream -The following endpoints should be routed direclty to the workers configured as +The following endpoints should be routed directly to the workers configured as stream writers for the `to_device` stream: ^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/ ##### The `account_data` stream -The following endpoints should be routed direclty to the workers configured as +The following endpoints should be routed directly to the workers configured as stream writers for the `account_data` stream: ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags @@ -423,7 +423,7 @@ stream writers for the `account_data` stream: ##### The `receipts` stream -The following endpoints should be routed direclty to the workers configured as +The following endpoints should be routed directly to the workers configured as stream writers for the `receipts` stream: ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt @@ -431,7 +431,7 @@ stream writers for the `receipts` stream: ##### The `presence` stream -The following endpoints should be routed direclty to the workers configured as +The following endpoints should be routed directly to the workers configured as stream writers for the `presence` stream: ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/.*/status$ From ac9cae4b55fb966a14ca1671189675f2749573fd Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Thu, 6 Jan 2022 14:08:21 -0500 Subject: [PATCH 09/19] Event persisters don't need to handle endpoints. --- docs/workers.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 21653194ac21..b73a25699c9b 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -377,16 +377,6 @@ them: ##### The `events` stream -The following endpoints should be routed directly to the workers configured as -stream writers for the `events` stream: - - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/redact - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/send - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state/ - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/(join|invite|leave|ban|unban|kick)$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/join/ - ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/ - The `events` stream also experimentally supports having multiple writers, where work is sharded between them by room ID. Note that you *must* restart all worker instances when adding or removing event persisters. An example `stream_writers` From 1c03c57bdca6011b4117fd042d44ed65efedb685 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 9 Feb 2022 14:45:45 -0500 Subject: [PATCH 10/19] Route all of /presence to workers. --- docs/workers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index b73a25699c9b..8f213d896473 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -272,7 +272,7 @@ below for more information. ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers # Presence requests - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/.*/status$ + ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ Additionally, the following REST endpoints can be handled for GET requests: @@ -424,7 +424,7 @@ stream writers for the `receipts` stream: The following endpoints should be routed directly to the workers configured as stream writers for the `presence` stream: - ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/.*/status$ + ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ #### Background tasks From 1ff67141985b4f80f26cd57bb6949a3b08460a46 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 9 Feb 2022 14:52:25 -0500 Subject: [PATCH 11/19] Consolidate some of the endpoints. --- docs/workers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 8f213d896473..7246ac08751f 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -229,8 +229,6 @@ below for more information. ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$ ^/_matrix/client/(api/v1|r0|v3|unstable)/account/3pid$ ^/_matrix/client/(api/v1|r0|v3|unstable)/devices$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/query$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/changes$ ^/_matrix/client/versions$ ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$ ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_groups$ @@ -241,6 +239,8 @@ below for more information. ^/_matrix/client/(api/v1|r0|v3|unstable)/search$ # Encryption requests + ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/query$ + ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/changes$ ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/claim ^/_matrix/client/(api/v1|r0|v3|unstable)/room_keys From 44853ea070646a3bdac4cf567fd43997afea6932 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 22 Feb 2022 13:34:03 -0500 Subject: [PATCH 12/19] Remove incorrect prefixes. --- docs/workers.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 6c535d62c427..30c315c0dd75 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -227,22 +227,22 @@ below for more information. ^/_matrix/client/unstable/org.matrix.msc2946/rooms/.*/spaces$ ^/_matrix/client/(v1|unstable/org.matrix.msc2946)/rooms/.*/hierarchy$ ^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/account/3pid$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/devices$ + ^/_matrix/client/(r0|v3|unstable)/account/3pid$ + ^/_matrix/client/(r0|v3|unstable)/devices$ ^/_matrix/client/versions$ ^/_matrix/client/(api/v1|r0|v3|unstable)/voip/turnServer$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_groups$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/publicised_groups$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/publicised_groups/ + ^/_matrix/client/(r0|v3|unstable)/joined_groups$ + ^/_matrix/client/(r0|v3|unstable)/publicised_groups$ + ^/_matrix/client/(r0|v3|unstable)/publicised_groups/ ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/event/ ^/_matrix/client/(api/v1|r0|v3|unstable)/joined_rooms$ ^/_matrix/client/(api/v1|r0|v3|unstable)/search$ # Encryption requests - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/query$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/changes$ - ^/_matrix/client/(api/v1|r0|v3|unstable)/keys/claim - ^/_matrix/client/(api/v1|r0|v3|unstable)/room_keys + ^/_matrix/client/(r0|v3|unstable)/keys/query$ + ^/_matrix/client/(r0|v3|unstable)/keys/changes$ + ^/_matrix/client/(r0|v3|unstable)/keys/claim + ^/_matrix/client/(r0|v3|unstable)/room_keys # Registration/login requests ^/_matrix/client/(api/v1|r0|v3|unstable)/login$ @@ -261,15 +261,15 @@ below for more information. ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing # Device requests - ^/_matrix/client/(api/v1|r0|v3|unstable)/sendToDevice/ + ^/_matrix/client/(r0|v3|unstable)/sendToDevice/ # Account data requests - ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/tags - ^/_matrix/client/(api/v1|r0|v3|unstable)/.*/account_data + ^/_matrix/client/(r0|v3|unstable)/.*/tags + ^/_matrix/client/(r0|v3|unstable)/.*/account_data # Receipts requests - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/receipt - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/read_markers + ^/_matrix/client/(r0|v3|unstable)/rooms/.*/receipt + ^/_matrix/client/(r0|v3|unstable)/rooms/.*/read_markers # Presence requests ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ From 00dad02b0b53b3cd5861913715da1e93322edc22 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 22 Feb 2022 15:11:02 -0500 Subject: [PATCH 13/19] Clarify how endpoints are used. --- docs/workers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 30c315c0dd75..00f4705535fb 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -179,9 +179,9 @@ recommend the use of `systemd` where available: for information on setting up ### `synapse.app.generic_worker` This worker can handle API requests matching the following regular expressions. -`GET` requests will be handled directly while `POST` and `PUT` requests will be -proxied to the proper worker. See the [stream writers](#stream-writers) section -below for more information. +These endpoints can be routed to any worker. If a worker is set up to handle a +stream then additional endpoints may be required to route to said worker, refer +to the [stream writers](#stream-writers) section below for further information. # Sync requests ^/_matrix/client/(v2_alpha|r0|v3)/sync$ From a5294879fadf81f666ec929d62fd32fcedda98e1 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 22 Feb 2022 15:11:16 -0500 Subject: [PATCH 14/19] Remove typing from generic worker -- it does not get proxied. --- docs/workers.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 00f4705535fb..fc7c65ff9fb0 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -257,9 +257,6 @@ to the [stream writers](#stream-writers) section below for further information. ^/_matrix/client/(api/v1|r0|v3|unstable)/join/ ^/_matrix/client/(api/v1|r0|v3|unstable)/profile/ - # Typing requests - ^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/typing - # Device requests ^/_matrix/client/(r0|v3|unstable)/sendToDevice/ From fcebe0beb6ce6310367a5d60fc88022b2a328a10 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 22 Feb 2022 15:13:30 -0500 Subject: [PATCH 15/19] Talk less about POST/PUT. --- docs/workers.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index fc7c65ff9fb0..b4a5bcff538d 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -365,12 +365,9 @@ stream_writers: events: event_persister1 ``` -Each of the streams have associated endpoints which should have `POST` and `PUT` -requests routed to the workers handling that stream. Otherwise, those requests -will be proxied to the proper worker. - -See below for the currently supported streams and the endpoints associated with -them: +Each of the streams have associated endpoints which should have requests routed +to the workers handling that stream. See below for the currently supported streams +and the endpoints associated with them: ##### The `events` stream From 9c2f94193427db3417c0b157834a6d53189f38d0 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 23 Feb 2022 10:18:52 -0500 Subject: [PATCH 16/19] Clarify documentation. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- docs/workers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index b4a5bcff538d..3cb7236d4363 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -180,7 +180,7 @@ recommend the use of `systemd` where available: for information on setting up This worker can handle API requests matching the following regular expressions. These endpoints can be routed to any worker. If a worker is set up to handle a -stream then additional endpoints may be required to route to said worker, refer +stream then additional endpoints may be required to route to said worker: refer to the [stream writers](#stream-writers) section below for further information. # Sync requests @@ -365,7 +365,7 @@ stream_writers: events: event_persister1 ``` -Each of the streams have associated endpoints which should have requests routed +Some of the streams have associated endpoints which should have requests routed to the workers handling that stream. See below for the currently supported streams and the endpoints associated with them: From 7fb456657e6ddb46169f9d66d8375e6e607d53a2 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 23 Feb 2022 12:40:02 -0500 Subject: [PATCH 17/19] Add end of string to regex. Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- docs/workers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workers.md b/docs/workers.md index 3cb7236d4363..bf4669ce6cec 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -241,7 +241,7 @@ to the [stream writers](#stream-writers) section below for further information. # Encryption requests ^/_matrix/client/(r0|v3|unstable)/keys/query$ ^/_matrix/client/(r0|v3|unstable)/keys/changes$ - ^/_matrix/client/(r0|v3|unstable)/keys/claim + ^/_matrix/client/(r0|v3|unstable)/keys/claim$ ^/_matrix/client/(r0|v3|unstable)/room_keys # Registration/login requests From b3dad90b4ed6d9ae1aa3c475cb5a6c1f083ce498 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 23 Feb 2022 17:21:23 -0500 Subject: [PATCH 18/19] Apply suggestions from code review Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- docs/workers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index bf4669ce6cec..2cb163a70405 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -180,7 +180,7 @@ recommend the use of `systemd` where available: for information on setting up This worker can handle API requests matching the following regular expressions. These endpoints can be routed to any worker. If a worker is set up to handle a -stream then additional endpoints may be required to route to said worker: refer +stream then, for maximum efficiency, additional endpoints should be routed to that worker: refer to the [stream writers](#stream-writers) section below for further information. # Sync requests @@ -242,7 +242,7 @@ to the [stream writers](#stream-writers) section below for further information. ^/_matrix/client/(r0|v3|unstable)/keys/query$ ^/_matrix/client/(r0|v3|unstable)/keys/changes$ ^/_matrix/client/(r0|v3|unstable)/keys/claim$ - ^/_matrix/client/(r0|v3|unstable)/room_keys + ^/_matrix/client/(r0|v3|unstable)/room_keys/ # Registration/login requests ^/_matrix/client/(api/v1|r0|v3|unstable)/login$ @@ -365,7 +365,7 @@ stream_writers: events: event_persister1 ``` -Some of the streams have associated endpoints which should have requests routed +Some of the streams have associated endpoints which, for maximum efficiency, should be routed to the workers handling that stream. See below for the currently supported streams and the endpoints associated with them: From 793548af79d2d6487966583a2b9f507a59e5fb9a Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 23 Feb 2022 17:22:10 -0500 Subject: [PATCH 19/19] Consistent line wrapping. --- docs/workers.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/workers.md b/docs/workers.md index 2cb163a70405..b82a6900acf4 100644 --- a/docs/workers.md +++ b/docs/workers.md @@ -180,8 +180,9 @@ recommend the use of `systemd` where available: for information on setting up This worker can handle API requests matching the following regular expressions. These endpoints can be routed to any worker. If a worker is set up to handle a -stream then, for maximum efficiency, additional endpoints should be routed to that worker: refer -to the [stream writers](#stream-writers) section below for further information. +stream then, for maximum efficiency, additional endpoints should be routed to that +worker: refer to the [stream writers](#stream-writers) section below for further +information. # Sync requests ^/_matrix/client/(v2_alpha|r0|v3)/sync$ @@ -365,9 +366,9 @@ stream_writers: events: event_persister1 ``` -Some of the streams have associated endpoints which, for maximum efficiency, should be routed -to the workers handling that stream. See below for the currently supported streams -and the endpoints associated with them: +Some of the streams have associated endpoints which, for maximum efficiency, should +be routed to the workers handling that stream. See below for the currently supported +streams and the endpoints associated with them: ##### The `events` stream