-
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
Make worker_monitor_drb act like a reader again! #14638
Make worker_monitor_drb act like a reader again! #14638
Conversation
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.
You can probably also remove
manageiq/app/models/miq_worker/runner.rb
Line 358 in 4a0ec8c
@worker_monitor_drb ||= worker_monitor_drb |
Otherwise looks good 👍
https://bugzilla.redhat.com/show_bug.cgi?id=1438935 For testing in e21d1b9, @worker_monitor_drb was changed to use the method. Unfortunately, this method isn't a reader, so it would create a new drb client each time it was called. It doesn't make sense for this method to make a new drb client each time, so we can cache this client on first access so it functions like a attr_reader now. We can then remove some memoization/caching that occurs in heartbeat since the getter method handles that for us.
147aa6b
to
a9726db
Compare
Checked commit jrafanie@a9726db with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/miq_worker/runner.rb
|
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.
👍 On less caching
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.
Looks good! 👍
@gtanzillo Making this a blocker since it floods the logs. Additionally, it creates a new DRb client each time we process a queue message, so it needs this PR fix. |
…ient_each_time Make worker_monitor_drb act like a reader again! (cherry picked from commit 56ee45a) https://bugzilla.redhat.com/show_bug.cgi?id=1439303
Fine backport details:
|
…ient_each_time Make worker_monitor_drb act like a reader again! (cherry picked from commit 56ee45a) https://bugzilla.redhat.com/show_bug.cgi?id=1439308
Euwe backport details:
|
https://bugzilla.redhat.com/show_bug.cgi?id=1438935
For testing in e21d1b9, @worker_monitor_drb was changed to use the
method. Unfortunately, this method isn't a reader, so it would create a
new drb client each time it was called.
It doesn't make sense for this method to make a new drb client each
time, so we can cache this client on first access so it functions like a
attr_reader now. We can then remove some memoization/caching that
occurs in heartbeat since the getter method handles that for us.
Use 147aa6b?w=1 to ignore whitespace.
Note, the parent PR, #14365, was backported to euwe.