Bug 988094 - [ExternalTasks] Cannot end existing job
Summary: [ExternalTasks] Cannot end existing job
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Eli Mesika
QA Contact:
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-24 17:42 UTC by Vojtech Szocs
Modified: 2013-09-23 07:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-23 07:28:09 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 17495 0 None None None Never
oVirt gerrit 18391 0 None None None Never

Description Vojtech Szocs 2013-07-24 17:42:00 UTC
Assume JOB_ID is ID of existing job.
Assume USER_ID is ID of existing user.

POST /api/jobs/JOB_ID/end
<action>
  <status>
    <state>FAILED</state>
  </status>
</action>

POST response = fault
<action>
    <status>
        <state>failed</state>
    </status>
    <fault>
        <reason>Operation Failed</reason>
        <detail>[action type non monitored]</detail>
    </fault>
</action>

GET /api/jobs/JOB_ID = job is still in STARTED state, POST request doesn't seem to have any effect
<job href="/api/jobs/JOB_ID" id="JOB_ID">
    <actions>
        <link href="/api/jobs/JOB_ID/clear" rel="clear"/>
        <link href="/api/jobs/JOB_ID/end" rel="end"/>
    </actions>
    <description>Test Job</description>
    <status>
        <state>STARTED</state>
    </status>
    <owner href="/api/users/USER_ID" id="USER_ID"/>
    <start_time>2013-07-24T14:31:01.882+02:00</start_time>
    <last_updated>2013-07-24T18:03:39.215+02:00</last_updated>
    <external>true</external>
    <auto_cleared>true</auto_cleared>
</job>

Please advise what is the proper way to end a job with given state.

Comment 1 Eli Mesika 2013-07-27 20:37:00 UTC
Is this the case were 

1)  All steps under the job were successfully ended manually 
2)  Then the job is attempted to end

Comment 2 Vojtech Szocs 2013-07-30 14:15:18 UTC
(In reply to Eli Mesika from comment #1)
> Is this the case were 
> 
> 1)  All steps under the job were successfully ended manually 
> 2)  Then the job is attempted to end

Yes, exactly. All steps under the given job were ended using succeeded=true because succeeded=false didn't work when trying to end a step (see https://bugzilla.redhat.com/988088).

So if all steps were ended as successful, the corresponding job will also be ended as successful? In other words, when ending a job, the status is calculated depending on status of all its steps?

Comment 3 Eli Mesika 2013-08-01 09:22:25 UTC
fixed in commit : 0052968

Comment 4 Itamar Heim 2013-08-21 16:41:01 UTC
as RC is built, moving to ON_QA (hopefully did not catch incorrect bugs when doing this)

Comment 5 Itamar Heim 2013-09-23 07:28:09 UTC
closing as this should be in 3.3 (doing so in bulk, so may be incorrect)


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