Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix worker doc for synapse.app.frontend_proxy #13451

Closed
wants to merge 5 commits into from

Conversation

dklimpel
Copy link
Contributor

@dklimpel dklimpel commented Aug 3, 2022

Fixes: #3717

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

Signed-off-by: Dirk Klimpel dirk@klimpel.org

@dklimpel dklimpel requested a review from a team as a code owner August 3, 2022 20:09
docs/workers.md Outdated Show resolved Hide resolved
docs/workers.md Outdated Show resolved Hide resolved
docs/workers.md Outdated
It will proxy any requests it cannot handle to the main synapse instance. It
It will proxy not cached requests to the main synapse instance. It
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of #6964, it looks like the frontend_proxy is really just a generic_worker in disguise. Should we move the frontend_proxy to the "Historical apps" section below?

(I'm very unfamiliar with the history here, maybe @matrix-org/synapse-core can advise).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more "Historical apps", IMO.

assert config.worker.worker_app in (
"synapse.app.appservice",
"synapse.app.client_reader",
"synapse.app.event_creator",
"synapse.app.federation_reader",
"synapse.app.federation_sender",
"synapse.app.frontend_proxy",
"synapse.app.generic_worker",
"synapse.app.media_repository",
"synapse.app.pusher",
"synapse.app.synchrotron",
"synapse.app.user_dir",
)

  • synapse.app.media_repository
  • synapse.app.pusher
  • synapse.app.federation_sender

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed, there is absolutely no difference between a frontend_proxy worker and a generic_worker nowadays; we should just get rid of this section.

... which makes me realise that generic_worker can actually handle requests to ^/_matrix/client/(r0|v3|unstable)/keys/upload, and we should add it to the list up there.

Looks like ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ is already in the list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what I should do? IMO a redesign of the docs should not part of this PR.
Moving URLs to generic_worker has impact to docker image. Or deprecate three worker types is a bigger change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only changes we need (for the documentation) are:

  • remove the section on frontend_proxy
  • add /_matrix/client/(r0|v3|unstable)/keys/upload to the list of URLs supported by generic_worker. It is currently supported, but not documented.

Moving URLs to generic_worker has impact to docker image.

we may need to update the docker image to match the recommendations from the documentation, but that can be done separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see this in this PR. This is a bit more.

  • frontend_proxy needs to be deprecated
  • It is not a simple move/add /_matrix/client/(r0|v3|unstable)/keys/upload, it needs an extra paragraph for the config param worker_main_http_uri, what is needed for the URL

It would make sense to create a PR for depracte all of the redundant workers:

  • synapse.app.media_repository
  • synapse.app.pusher
  • synapse.app.federation_sender

Copy link
Member

@richvdh richvdh Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see this in this PR.

I can't insist, but it just doesn't seem worth making minor corrections to text that is fundamentally outdated.

This is a bit more.

  • frontend_proxy needs to be deprecated

I don't think we need a particular deprecation notice. frontend_proxy is just another example of the redundant workers that are covered under Historical apps, much like client_reader and event_creator (which were removed in #7969).

  • It is not a simple move/add /_matrix/client/(r0|v3|unstable)/keys/upload, it needs an extra paragraph for the config param worker_main_http_uri, what is needed for the URL

Oh bother, that's true. Yes, we should really move the existing text on worker_main_http_uri to the general Worker configuration section. (and probably mention it again next to /_matrix/client/(r0|v3|unstable)/keys/upload.

It would make sense to create a PR for depracte all of the redundant workers:

  • synapse.app.media_repository
  • synapse.app.pusher
  • synapse.app.federation_sender

media_repository isn't (yet) redundant, afaik: a generic_worker cannot handle the /media endpoints. But in general I think it makes more sense to consider each worker app in turn, in separate PRs. #10441 tracks this work.

docs/workers.md Outdated Show resolved Hide resolved
@DMRobertson DMRobertson requested a review from a team August 4, 2022 12:00
@DMRobertson
Copy link
Contributor

Back in the queue for another set of eyes.

Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
changelog.d/13451.doc Outdated Show resolved Hide resolved
docs/workers.md Outdated
It will proxy any requests it cannot handle to the main synapse instance. It
It will proxy not cached requests to the main synapse instance. It
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed, there is absolutely no difference between a frontend_proxy worker and a generic_worker nowadays; we should just get rid of this section.

... which makes me realise that generic_worker can actually handle requests to ^/_matrix/client/(r0|v3|unstable)/keys/upload, and we should add it to the list up there.

Looks like ^/_matrix/client/(api/v1|r0|v3|unstable)/presence/ is already in the list.

dklimpel and others added 2 commits August 9, 2022 08:51
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Comment on lines +592 to 598
If `use_presence` is set to `false` in the homeserver config, the frontend proxy can also handle REST
endpoints matching the following regular expression:

^/_matrix/client/(api/v1|r0|v3|unstable)/presence/[^/]+/status

This "stub" presence handler will pass through `GET` request but make the
`PUT` effectively a no-op.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It really doesn't matter whether use_presence is set to false or not: any worker can now handle ^/_matrix/client/.../presence/[^/]+/status. It is no longer a "stub".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

frontend_proxy worker claims it forwards requests to the main process, but it doesn't
3 participants