-
Notifications
You must be signed in to change notification settings - Fork 900
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
Queue the VM scan command after vm_scan_start event is handled by automate. #15228
Queue the VM scan command after vm_scan_start event is handled by automate. #15228
Conversation
@lfu Cannot apply the following label because they are not recognized: bugs |
@miq-bot add_label bug |
ac170ee
to
bbf41a5
Compare
app/models/vm_scan.rb
Outdated
:instance_id => id, | ||
:method_name => "signal", | ||
:args => [:abort, message, "error"], | ||
:zone => from_zone, # continue in the same zone where the scan event is created |
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.
Let's update the comment to say: # Continue in the same zone were the scan job was initiated.
bbf41a5
to
ed22062
Compare
app/models/vm_scan.rb
Outdated
unless status == 'ok' | ||
_log.error("Status = #{status}, message = #{message}") | ||
signal(:abort, message, "error") | ||
MiqQueue.put_unless_exists( |
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.
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.
@lfu Is there a reason to queue this one? It is early enough in the VMscan process that there should not be any requirement to talk to the provider. Could this remain as the signal(:abort, message, "error")
call?
@gmcculloug Can we justify the use case. Are we expecting duplicate entries being created in a short time frame. Could this just be MiqQueue.put |
User might run the task again if it is backed up for some reason. There is no way from UI side to prevent running multiple scanning for the same target. |
@mkanoor @lfu The VM This logic is all happening after we have initiated the scan so I do see multiple scans running at the same time being an issue. Both of the MiqQueue.put calls are already for a specific instance of VmScan. My thinking is this could be just |
@lfu @gmcculloug |
Yes, but I do not think that applies to this PR as we still need to handle the states of the scan job. |
ed22062
to
1c18b89
Compare
spec/models/vm_scan_spec.rb
Outdated
end | ||
|
||
it "does not send signal :abort if passed status is 'ok' " do | ||
expect(MiqQueue).not_to receive(:put_unless_exists).with( |
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.
This test needs to be updated as it is still based on MiqQueue
.
…omate. All events are handled by automate role server. And VM scan is handled only by SmartState role server. Queueing the VM scan signal for next step allows the separation of these two server roles. https://bugzilla.redhat.com/show_bug.cgi?id=1454936
1c18b89
to
e86b4a0
Compare
Checked commits lfu/manageiq@234af0a~...e86b4a0 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Queue the VM scan command after vm_scan_start event is handled by automate. (cherry picked from commit 7a7350e) https://bugzilla.redhat.com/show_bug.cgi?id=1457899
Euwe backport details:
|
Queue the VM scan command after vm_scan_start event is handled by automate. (cherry picked from commit 7a7350e) https://bugzilla.redhat.com/show_bug.cgi?id=1460339
Fine backport details:
|
All events are handled by automate role server. And VM scan is handled only by SmartState role server.
Queueing the VM scan signal for next step allows the separation of these two server roles.
https://bugzilla.redhat.com/show_bug.cgi?id=1454936
@miq-bot assign @gmcculloug
@miq-bot add_label bugs, euwe/yes, fine/yes, smart state