Skip to content

Conversation

DineshDevarajan
Copy link
Contributor

@DineshDevarajan DineshDevarajan commented Oct 7, 2020

Description

This pull request fixes bug #1805 .
Set the overall job status to Failed, if any one of the job is Failed.

Changes

Corrected the order of job status verification in such a way that Failure status is validated first.

How to test

curl -k -s -S -X GET http://localhost/repo/api/v1/jobs?upload=<id> -H "Authorization: Bearer <TOKEN>"

Response :

[
{
"id": 3,
"name": "filename",
"queueDate": "2020-10-06 12:17:51.458106+00",
"uploadId": "3",
"userId": "3",
"groupId": "3",
"eta": 0,
"status": "Failed" ->>>>>> Without this fix Job status is showing as Queued even when ununpack is failed.
}
]

Fixes #1805

when any one of the job is failed
@DineshDevarajan DineshDevarajan marked this pull request as ready for review October 8, 2020 09:18
@GMishx GMishx self-assigned this Oct 14, 2020
@GMishx
Copy link
Member

GMishx commented Oct 14, 2020

Thank you for your contribution @DineshDevarajan .

I just tested the PR and it works for the mentioned scenario:

  • master reports Queued even if ununpack fails.
  • This branch reports Failed

But since you have mentioned #1800, are you going to fix other issues mentioned in it as well?
E.g. If an agent fails for a scan, every other job is marked failed as well (even delagent)

@DineshDevarajan
Copy link
Contributor Author

@GMishx Sorry for the confusion i wanted to fix #1805 (REST API: Jobs end point says job status as queued when ununpack is failed). (Corrected the Description) .

Regarding Fix for #1800 i am not sure about the steps to reproduce. Please see my comments below

#1805 (comment)

@GMishx
Copy link
Member

GMishx commented Oct 14, 2020

Oh, thanks for the clarification. It does solve #1805

I missed your comment. Will reply to it.

Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good. Tested, working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REST API: Jobs end point says job status as queued when ununpack is failed

2 participants