-
Notifications
You must be signed in to change notification settings - Fork 429
set worker_name compatible with k8s horizontal pod autoscaling #19285
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
base: develop
Are you sure you want to change the base?
Conversation
|
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 | ||
|
|
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.
@gaelgatelement I'm curious on your opinion about this kind of change being familiar deploying Synapse with K8s
| self.worker_name = self.worker_app | ||
| if self.worker_app: | ||
| self.worker_name = config.get("worker_name", environ.get("HOSTNAME")) |
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.
Is this equivalent? It seems like this will always get overriden when self.worker_app is set.
| 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 |
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 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")) |
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 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.
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 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 | ||
|
|
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.
CLA needs to be signed
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.
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?
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.
@shcherbak Perhaps easiest 🤷
Sorry for the hassle
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