-
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
Look up worker by guid not pid #19557
Look up worker by guid not pid #19557
Conversation
When each worker is running as a container, each worker gets its own process space meaning it's more than likely that there will by duplicate worker pids for the same server. This would make MiqWorker.my_worker unreliable. This commit saves the worker guid into a class attribute on MiqWorker so that we can access it at any time within the process.
This is needed because MiqQueue.get updates the handler using MiqWorker.my_worker which needs the global guid to be set. Without this the #active_messages relation for the worker record was empty because it joins based on the queue message handler_id
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.
Wow, this looks so simple. Awesome.
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
Checked commits carbonin/manageiq@e627261~...18fab45 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
When each worker is running as a container, each worker gets its
own process space meaning it's more than likely that there will
by duplicate worker pids for the same server. This would make
MiqWorker.my_worker unreliable.
This commit saves the worker guid into a class attribute on MiqWorker
so that we can access it at any time within the process.