Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't regenerate numeric user ID if registration fails. #6161

Merged
merged 4 commits into from Oct 7, 2019

Conversation

@erikjohnston
Copy link
Member

erikjohnston commented Oct 3, 2019

This causes huge amounts of DB IO if registrations start to fail e.g. because the DB is struggling with IO.

erikjohnston added 2 commits Oct 3, 2019
This causes huge amounts of DB IO if registrations start to fail e.g.
because the DB is struggling with IO.
@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Oct 3, 2019
@@ -220,7 +220,7 @@ def register_user(
attempts = 0
user = None
while not user:
localpart = yield self._generate_user_id(attempts > 0)
localpart = yield self._generate_user_id()

This comment has been minimized.

Copy link
@richvdh

richvdh Oct 3, 2019

Member

attempts is now redundant

@@ -0,0 +1 @@
Don't regenerate numeric user ID if registration fails.

This comment has been minimized.

Copy link
@richvdh

richvdh Oct 3, 2019

Member

bugfix? with a description of what it fixes?

@erikjohnston

This comment has been minimized.

Copy link
Member Author

erikjohnston commented Oct 3, 2019

This is the final fix for #5225. We had already added a lock

@richvdh
richvdh approved these changes Oct 3, 2019
Copy link
Member

richvdh left a comment

lgtm then

@erikjohnston erikjohnston merged commit 2cb7466 into develop Oct 7, 2019
18 checks passed
18 checks passed
buildkite/synapse Build #4771 passed (36 minutes, 49 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 32 seconds)
Details
buildkite/synapse/check-style Passed (3 minutes, 18 seconds)
Details
buildkite/synapse/isort Passed (34 seconds)
Details
buildkite/synapse/mypy Passed (25 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (31 seconds)
Details
buildkite/synapse/packaging Passed (36 seconds)
Details
buildkite/synapse/pipeline Passed (2 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (19 minutes, 44 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (6 minutes, 2 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite-slash-old-deps Passed (8 minutes, 40 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (5 minutes, 16 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (17 minutes, 28 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (20 minutes, 26 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (5 minutes, 24 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-monolith Passed (11 minutes, 36 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-workers Passed (12 minutes, 52 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-sqlite-slash-monolith Passed (11 minutes, 43 seconds)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.