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

Look up worker by guid not pid #19557

Merged
merged 4 commits into from
Nov 26, 2019

Conversation

carbonin
Copy link
Member

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.

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
Copy link
Member

@jrafanie jrafanie left a 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.

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@miq-bot
Copy link
Member

miq-bot commented Nov 26, 2019

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
5 files checked, 0 offenses detected
Everything looks fine. 🍪

@Fryguy Fryguy merged commit bfb2439 into ManageIQ:master Nov 26, 2019
@Fryguy Fryguy added this to the Sprint 126 Ending Dec 9, 2019 milestone Nov 26, 2019
@carbonin carbonin deleted the fix_my_worker_for_containers branch December 3, 2019 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants