This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Handle replication commands synchronously where possible #7876
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
richvdh
force-pushed
the
rav/synchronous_replication
branch
3 times, most recently
from
July 16, 2020 22:47
a2999a7
to
ad48936
Compare
... and only start a background process if they are async.
fire up a background process only when we start processing the queue.
richvdh
force-pushed
the
rav/synchronous_replication
branch
from
July 16, 2020 23:08
ad48936
to
ebee62d
Compare
erikjohnston
suggested changes
Jul 17, 2020
|
||
Does not check if there is already a thread processing the queue, hence "unsafe" | ||
""" | ||
self._processing_streams.add(stream_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add another guard here to test stream_name in self._processing_streams
in case there is a race? I don't think there should be but it requires understanding how run_as_background_process
works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a pattern we use pretty widely across the codebase. I've added an assertion.
looks like something has broken here; am investigating. |
erikjohnston
approved these changes
Jul 27, 2020
Co-authored-by: Erik Johnston <erik@matrix.org>
This also fixes a potential assertion failure introduced in #7861:
|
richvdh
added a commit
that referenced
this pull request
Jul 28, 2020
Synapse 1.18.0rc2 (2020-07-28) ============================== Bugfixes -------- - Fix an `AssertionError` exception introduced in v1.18.0rc1. ([\#7876](#7876)) - Fix experimental support for moving typing off master when worker is restarted, which is broken in v1.18.0rc1. ([\#7967](#7967)) Internal Changes ---------------- - Further optimise queueing of inbound replication commands. ([\#7876](#7876))
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most of the stuff we do for replication commands can be done synchronously. There's no point spinning up background processes if we're not going to need them.