-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Introduce update_user_directory_on
#11450
Introduce update_user_directory_on
#11450
Conversation
Blocked on matrix-org/sytest#1173 to let sytest worker tests proceed correctly. |
I added backwards compatibility to this, this is unblocked now. |
I have not looked at the patch, but it'd be quite nice to keep the disabling side effect of the flag. In my use case, t2bot.io doesn't update the user directory at all and there is no worker for it, so the original intent of the setting was to save CPU/DB cycles. I will admit that it's a use case with sample size 1 though. |
Technically it would still work, as no string can match |
can it get documented as a feature please? 😇 Relying on magic behaviour isn't great. |
Head branch was pushed to by a user without write access
worker_to_update_user_directory
update_user_directory_on
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.
this is definitely much clearer and easier to follow now, thanks! A few notes though.
Co-authored-by: Richard van der Hoff <[email protected]>
synapse/app/generic_worker.py
Outdated
@@ -126,6 +126,11 @@ | |||
|
|||
logger = logging.getLogger("synapse.app.generic_worker") | |||
|
|||
DIRECTORY_UPDATE_WARNING = """ | |||
The user directory worker is not allowed to perform user directory updates per the config. |
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.
right, I see the confusion here now. "not allowed to" sounds like I've tried to enable something invalid. Maybe s/not allowed to/not configured to/
.
But I don't really understand why this is a thing we need to warn about. Why is it a problem if the updates are done on the main process?
Note that the current wording sounds very much like an error, indicating something that definitely won't work.
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.
Maybe s/not allowed to/not configured to/.
👍
Why is it a problem if the updates are done on the main process?
That's not the problem, the problem is is that the configuration does not appoint the local worker to do the updates.
The config can now appoint any worker to do this job by its name, so the job of the user directory worker isn't that unique anymore, but it's uniqueness is still supported by synapse.
Note that the current wording sounds very much like an error
That's because it is, the local worker has a "type" of being a designated user update worker, while the configuration does not allow it to do just that. This is more or less a warning that "your config, as-is, is contradictory"
The previous version exited the process with 1
when hitting this point, should that be re-introduced?
Ugh, I remain hopelessly confused about what is going on here, and how it fixes the original issue (#10339). I have commented there. |
I'll be closing this PR in light of the retrospective at #10339 (comment), where it became clear this PR is the wrong solution to this problem. |
Fixes #10339
This changes the
update_user_directory
config variable to aupdate_user_directory_on
variable, which more explicitly points or denotes which process is supposed to be working user directory updates. This defaults to the main process.Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)
Signed-off-by: Jonathan de Jong <[email protected]>