Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1360373 - When failing on command execution after one task was created the command will reach endSuccesfully() instead of endWithFailure()
Summary: When failing on command execution after one task was created the command will...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ovirt-4.0.4
: 4.0.4
Assignee: Ravi Nori
QA Contact: Petr Matyáš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-26 14:25 UTC by Liron Aravot
Modified: 2016-09-26 12:34 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-26 12:34:17 UTC
oVirt Team: Infra
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
mgoldboi: planning_ack+
mperina: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)
engine log (deleted)
2016-07-26 14:25 UTC, Liron Aravot
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 61689 master MERGED engine : Async tasks should handle exception in creating task 2016-08-11 11:14:49 UTC
oVirt gerrit 62264 ovirt-engine-4.0 MERGED engine : Async tasks should handle exception in creating task 2016-08-12 07:17:55 UTC

Description Liron Aravot 2016-07-26 14:25:25 UTC
Created attachment 1184283 [details]
engine log

Description of problem:
When a command that executes few child commands that each create task (the common usecase - for example: ImportVm/ExportVm) and failing after the first task was created (for example: when attempting to initiate the second task) the command endSuccesfully() will be executed although the execution has failed.


How reproducible:
Always

Steps to Reproduce:
1. Attempt to Export a VM with 2 disks
2. Make sure that the first task creation will succeed
3. Make sure that the first task creation will fail

Actual results:
ExportVmCommand.endSuccesfully() will be executed

Expected results:
ExportVmCommand.endWithFailure() should be executed

Additional info:
This is a regression, worked previously.

Comment 1 Oved Ourfali 2016-07-27 08:16:34 UTC
Liron - it fails only on 4.1?
Aharon, can you test it on 4.0 and 3.6.8?

Comment 2 Aharon Canan 2016-07-27 08:23:28 UTC
(In reply to Oved Ourfali from comment #1)

> Aharon, can you test it on 4.0 and 3.6.8?

Kevin, 

Please do.

Comment 3 Liron Aravot 2016-07-27 08:31:50 UTC
(In reply to Oved Ourfali from comment #1)
> Liron - it fails only on 4.1?
> Aharon, can you test it on 4.0 and 3.6.8?

I've tested only on 4.1, Kevin will update on 4/3.6.8.

Comment 4 Aharon Canan 2016-07-27 08:52:43 UTC
Restoring Needinfo on Kevin

Comment 5 Martin Perina 2016-07-28 12:08:52 UTC
Ravi, could you please investigate?

Comment 6 Ravi Nori 2016-07-28 17:07:42 UTC
AsyncTaskManager gets task statuses directly from vdsm. Setting a break point and modifying the status of individual VdcCommand executions is not going to effect what the AsyncTaskManager sees.

However setting a break point in HSMGetAllTasksStatusesVDSCommand at parseTaskStatusList and modifying the return values works. To do this set the value of AsyncTaskStatus.result to AsyncTaskResultEnum.failure for the second MoveImageGroupVDSCommand. When this is done ExportVmCommand's endWithFailure is invoked and everything works.

Comment 7 Ravi Nori 2016-07-29 15:02:09 UTC
I was able to reproduce this on master by manually failing execution of second submission to vdsm using break points.

Comment 8 Martin Perina 2016-08-11 11:15:32 UTC
Moving back to POST, we need to backport ovirt-engine-4.0 branch

Comment 9 Kevin Alon Goldblatt 2016-08-14 15:40:34 UTC
(In reply to Aharon Canan from comment #4)
> Restoring Needinfo on Kevin

On 3.6.x it works as expected.

Tested with the following code:
----------------------------------
vdsm-4.17.33-1.el7ev.noarch
rhevm-3.6.8.1-0.1.el6.noarch


Tested with the following scenario:
------------------------------------
Steps to Reproduce:
1. Attempt to Export a VM with 2 disks
2. Make sure that the first task creation will succeed
3. Make sure that the next task creation will fail

Actual results:
ExportVmCommand.endWithFailure() was executed



From engine.log:
-------------------
2016-08-14 15:27:46,034 INFO  [org.ovirt.engine.core.bll.tasks.CommandAsyncTask] (org.ovirt.thread.pool-6-thread-27) [1c7171
50] CommandAsyncTask::endCommandAction [within thread] context: Attempting to endAction 'ExportVm', executionIndex: '0'
2016-08-14 15:27:46,086 ERROR [org.ovirt.engine.core.bll.ExportVmCommand] (org.ovirt.thread.pool-6-thread-27) [1c717150] End
ing command 'org.ovirt.engine.core.bll.ExportVmCommand' with failure.

Comment 10 Petr Matyáš 2016-09-08 13:44:57 UTC
Verified on 4.0.4-1


Note You need to log in before you can comment on or make changes to this bug.