-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[serve] Update replica ID format (and other random strings) to better match UUIDs #41737
Conversation
@@ -614,7 +614,7 @@ def shutdown(self): | |||
and proxy_state_is_shutdown | |||
): | |||
logger.warning( | |||
"All resources have shut down, shutting down controller!", |
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.
@GeneDer reminder to mostly avoid exclamation points in log messages (and other technical writing)
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.
will do👍
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.
def get_random_letters(length=6): | ||
return "".join(random.choices(string.ascii_letters, k=length)) | ||
# Match the standard alphabet used for UUIDs. | ||
RANDOM_STRING_ALPHABET = string.ascii_lowercase + string.digits |
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.
Non-blocker: A bit nit, since we now allows digits, maybe can name it RANDOM_STRING_ALPHANUMERIC
instead? 🙃
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.
Also kinda after thought, there is also a UUID module in python not sure if we want to consider using that
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.
yes we use UUID
elsewhere but here the length of the UUID is overkill and will degrade the UX for reading logs (replica IDs are scoped to a single deployment in a single cluster)
Why are these changes needed?
Small cosmetic update to our replica ID generation to make it use the same alphabet as
UUID
(which is standard and we use for request IDs).Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.