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

Split out registration to worker #4666

Merged
merged 6 commits into from
Feb 18, 2019
Merged

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Feb 18, 2019

This allows registration to be handled by a worker, though the actual
write to the database still happens on master.

Note: due to the in-memory session map all registration requests must be
handled by the same worker.

This allows registration to be handled by a worker, though the actual
write to the database still happens on master.

Note: due to the in-memory session map all registration requests must be
handled by the same worker.
@erikjohnston
Copy link
Member Author

Note: the changes to synapse/storage/registration.py are simply moving APIs into the RegistrationWorkerStore

@erikjohnston erikjohnston requested a review from a team February 18, 2019 12:18
@codecov-io
Copy link

codecov-io commented Feb 18, 2019

Codecov Report

Merging #4666 into develop will decrease coverage by 0.18%.
The diff coverage is 65.21%.

@@             Coverage Diff             @@
##           develop    #4666      +/-   ##
===========================================
- Coverage    75.27%   75.08%   -0.19%     
===========================================
  Files          338      340       +2     
  Lines        34620    34828     +208     
  Branches      5669     5723      +54     
===========================================
+ Hits         26060    26152      +92     
- Misses        6967     7070     +103     
- Partials      1593     1606      +13

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

generally lgtm

initial_display_name = content["initial_display_name"]
is_guest = content["is_guest"]

device_id = yield self.device_handler.check_device_registered(
Copy link
Member

Choose a reason for hiding this comment

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

I wish we didn't have to duplicate this code between the rest code and here. Can it not find a handler to go and live in?

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 put it in RegistrationHandler. I was going to put it in LoginHandler, then AuthHandler and then DeviceHandler, but they all had various problems that made me cry, so I gave up and put it in RegistrationHandler.

@erikjohnston
Copy link
Member Author

I'm afraid I had to fix the tests to not mock out all the registration handler stuff, as otherwise I would have ended up mocking out literally everything to make the tests pass, which feels counter productive.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm

@erikjohnston erikjohnston merged commit fc2c245 into develop Feb 18, 2019
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.

4 participants