Skip to content
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

Persistent random server id generation #5

Merged
merged 10 commits into from
May 20, 2021

Conversation

weihao
Copy link
Contributor

@weihao weihao commented May 20, 2021

Summary

Implemented a random UUID generation for empty server ids a few weeks ago, and I saw the limework fork has implemented a UUID generation too but it is not exactly what I wanted, so I want to share this PR with the maintainers.

Goal

This PR generates a random UUID when the initial config is empty, and then it saves the generated id to the config file.

Details

In the limework's implementation, if you always generate and append a random UUID on the flight, the heartbeat will not work.

Unlike limework's implementation, my UUID generation is persistent, and I use it for cloud deployments. Many instances copy from the same source for config files, generates random proxy ids, and save them. Persistency is required to recover from a crash as there are data in Redis linked to the server id.

@weihao weihao changed the title Limework master Persistent random server id generation May 20, 2021
@ham1255
Copy link
Member

ham1255 commented May 20, 2021

Thanks for the pull request i admit away i have done it is bit weird

@ham1255 ham1255 added the enhancement New feature or request label May 20, 2021
@ham1255 ham1255 requested review from ham1255 and a user May 20, 2021 06:49
@ham1255
Copy link
Member

ham1255 commented May 20, 2021

I found a bug somehow saving the config causes all comments to go away!

@ham1255
Copy link
Member

ham1255 commented May 20, 2021

thanks for pull request again! merged

@ham1255 ham1255 closed this May 20, 2021
@ham1255 ham1255 reopened this May 20, 2021
@ham1255 ham1255 merged commit 373e1c1 into ProxioDev:master May 20, 2021
@ham1255 ham1255 removed their request for review May 21, 2021 00:02
@weihao
Copy link
Contributor Author

weihao commented May 21, 2021

I found a bug somehow saving the config causes all comments to go away!

This is the expected behavior, yamlconfig loads yaml file into configuration, and all the comments are discarded. the changes you make are in memory and when write to disks, the comments are discarded because they were never loaded.

@ham1255
Copy link
Member

ham1255 commented May 21, 2021

I found a bug somehow saving the config causes all comments to go away!

This is the expected behavior, yamlconfig loads yaml file into configuration, and all the comments are discarded. the changes you make are in memory and when write to disks, the comments are discarded because they were never loaded.

yeah thanks for telling since i think this was snake yaml limitation but it think writing our own yaml parser should do it.

@xsorencoolx xsorencoolx mentioned this pull request May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants