-
Notifications
You must be signed in to change notification settings - Fork 897
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
Auto-restart systemd workers results in duplicates #20824
Auto-restart systemd workers results in duplicates #20824
Conversation
Because the worker GUID is part of the systemd service when a systemd worker is restarted by systemd it will get a new PID but reuse the old GUID. If MiqServer deletes the worker row because it doesn't see the PID then you end up with a service restarting and failing to find its row constantly.
I don't like where we write these files out, I'd prefer we write them once on startup and move on. Going to tackle that then take this out of WIP. |
08d5894
to
4b54bce
Compare
When the systemd worker option was first introduced as a prototype there was a setting that would control if systemd or the normal forking worker mode was used. This setting was per worker, and was done in sync_workers so that you could change the setting "on-the-fly" without restarting the entire evmserverd process. This made it much easier to try out using systemd on one or two workers very quickly. Now that systemd is the default for appliances the ability to change this dynamically isn't very helpful, and writing out systemd unit files during sync_workers is just a lot of overhead. Moving the writing of systemd unit files to miq_server startup removes the overhead per-sync_workers-loop and allows us to update the contents of the files without checking .exist? (which was done due to the frequency with which it was being run).
532a99d
to
d215045
Compare
Checked commits agrare/manageiq@b734fad~...d215045 with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint |
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.
LGTM 👍
@jrafanie are you waiting on something/someone before merging? |
Just travis...it's green now, thanks for the ping |
…omatically Auto-restart systemd workers results in duplicates (cherry picked from commit 2f8ae23)
Kasparov backport details:
|
Because the worker GUID is part of the systemd service when a systemd worker is restarted by systemd it will get a new PID but reuse the old GUID.
If MiqServer deletes the worker row because it doesn't see the PID then you end up with a service restarting and failing to find its row constantly.
Fixes #20822