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

Add support for sharding the client reader. #7830

Merged
merged 2 commits into from
Jul 13, 2020
Merged

Conversation

clokep
Copy link
Member

@clokep clokep commented Jul 13, 2020

This is mostly just tests, but does make one change to ensure that a background process only runs on a single process. I'm not 100% sure this is necessary, but I think it is.

Fixes #7672

@clokep clokep force-pushed the clokep/client-reader-tests branch from daa2c27 to bae66a7 Compare July 13, 2020 15:27
@clokep clokep force-pushed the clokep/client-reader-tests branch from bae66a7 to c11f7ee Compare July 13, 2020 15:35
@clokep clokep requested a review from a team July 13, 2020 15:51
@clokep clokep marked this pull request as ready for review July 13, 2020 15:58
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

This looks good, could you update the docs/workers.md too please?

changelog.d/7830.feature Outdated Show resolved Hide resolved
Co-authored-by: Erik Johnston <erik@matrix.org>
@@ -40,7 +40,8 @@ def __init__(self, hs):

# Start the user parter loop so it can resume parting users from rooms where
# it left off (if it has work left to do).
hs.get_reactor().callWhenRunning(self._start_user_parting)
if hs.config.worker_app is None:
hs.get_reactor().callWhenRunning(self._start_user_parting)
Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is worth pointing out also that we don't seem to use this pattern of callWhenRunning anywhere else for background processes. I wonder if that method can just go away and we can directly call the code from it?

Not really related to this PR, just found it odd.

Copy link
Member

Choose a reason for hiding this comment

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

I think we tend to do loopings calls, which also won't run until we're started? I think it makes sense to only start work once we've finished starting up

@clokep clokep requested a review from erikjohnston July 13, 2020 17:01
@clokep
Copy link
Member Author

clokep commented Jul 13, 2020

@erikjohnston Not sure if you meant to approve this or not. 😄

@erikjohnston
Copy link
Member

Oh, I was waiting on words in docs/workers.md

@clokep clokep merged commit 457096e into develop Jul 13, 2020
@clokep clokep deleted the clokep/client-reader-tests branch July 13, 2020 17:31
babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit '457096e6d':
  Support handling registration requests across multiple client readers. (#7830)
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.

Shard Client Reader for registration
2 participants