Skip to content

Conversation

@shcherbak
Copy link

master worker needs to "know" names of workers by type. this patch allows to use kubernetes HPA because worker name is based on hostname which is equals to pod name in kubernetes

@shcherbak shcherbak requested a review from a team as a code owner December 6, 2025 09:00
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


iops seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

if self.worker_app:
self.worker_name = config.get("worker_name", environ.get("HOSTNAME"))
self.instance_name = self.worker_name or MAIN_PROCESS_INSTANCE_NAME

Copy link
Contributor

Choose a reason for hiding this comment

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

@gaelgatelement I'm curious on your opinion about this kind of change being familiar deploying Synapse with K8s

Comment on lines +262 to +264
self.worker_name = self.worker_app
if self.worker_app:
self.worker_name = config.get("worker_name", environ.get("HOSTNAME"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this equivalent? It seems like this will always get overriden when self.worker_app is set.

Suggested change
self.worker_name = self.worker_app
if self.worker_app:
self.worker_name = config.get("worker_name", environ.get("HOSTNAME"))
if self.worker_app:
self.worker_name = config.get("worker_name", environ.get("HOSTNAME"))

self.worker_replication_secret = worker_replication_secret

self.worker_name = config.get("worker_name", self.worker_app)
from os import environ
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be organized into the imports at the top of the file

from os import environ
self.worker_name = self.worker_app
if self.worker_app:
self.worker_name = config.get("worker_name", environ.get("HOSTNAME"))
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes the previous behavior where we previously read from config.get("worker_name") and had a fallback to the self.worker_app.

Now it will config.get("worker_name") -> environ.get("HOSTNAME")

Overall, I'm not very convinced of the change yet.

Copy link
Author

Choose a reason for hiding this comment

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

This for statically scaled worker, that registered in master worker. We use state full sets to have predictable names

if self.worker_app:
self.worker_name = config.get("worker_name", environ.get("HOSTNAME"))
self.instance_name = self.worker_name or MAIN_PROCESS_INSTANCE_NAME

Copy link
Contributor

Choose a reason for hiding this comment

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

CLA needs to be signed

Copy link
Author

@shcherbak shcherbak Dec 17, 2025

Choose a reason for hiding this comment

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

CLA needs to be signed

I signed it as GH user, but git remembers my local Linux user as co-author . Should I rewrite PR and send it with correct .gitconfig?

Copy link
Contributor

Choose a reason for hiding this comment

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

@shcherbak Perhaps easiest 🤷

Sorry for the hassle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants