Bug 988094

Summary: [ExternalTasks] Cannot end existing job
Product: [Retired] oVirt Reporter: Vojtech Szocs <vszocs>
Component: ovirt-engine-coreAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3CC: acathrow, emesika, iheim, vszocs, yzaslavs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-23 07:28:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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)