-
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
Check for messages key in prefetch_below_threshold? #15620
Conversation
@gtanzillo Please take a look. |
@miq-bot assign @gtanzillo |
@@ -61,7 +61,7 @@ def prefetch_stale_threshold | |||
|
|||
def prefetch_below_threshold?(queue_name, wcount) | |||
@queue_messages_lock.synchronize(:SH) do | |||
return false if @queue_messages[queue_name].nil? | |||
return false if @queue_messages[queue_name].nil? || @queue_messages[queue_name][:messages].nil? |
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.
In this case prefer fetch_path
return false if @queue_messages.fetch_path(queue_name, :messages).nil?
Alternately, if you are saying the key may or may not exist (as opposed to key existing with a nil value), then you can use key_path?
return false unless @queue_messages.key_path?(queue_name, :messages)
@Fryguy done. |
Checked commit https://github.com/djberg96/manageiq/commit/8c3d35f9603453c142c5afa1fd9d15c4e6a4bab9 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
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
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.
👍
@miq-bot add_label fine/yes |
@miq-bot add_label euwe/yes |
Check for messages key in prefetch_below_threshold? (cherry picked from commit 6e08686) https://bugzilla.redhat.com/show_bug.cgi?id=1480629
Fine backport details:
|
Check for messages key in prefetch_below_threshold? (cherry picked from commit 6e08686) https://bugzilla.redhat.com/show_bug.cgi?id=1480630
Euwe backport details:
|
Check for messages key in prefetch_below_threshold? (cherry picked from commit 6e08686) https://bugzilla.redhat.com/show_bug.cgi?id=1480629
A customer log showed a worker failure that seems to be caused by a failed
.nil?
check in theMiqServer::WorkerManagement::Dequeue#prefetch_below_threshold?
method. Below is a snippet from their evm.log:The proposed change just adds an explicit check on
@queue_messages[queue_name][:messages]
.Attempts to resolve https://bugzilla.redhat.com/show_bug.cgi?id=1471232