apache / apache/cloudstack

Inconsistent jobstatus in queryAsyncJobResult API response

Đang mở
#12,538 1 bình luận 1 reaction 1 người được giao Được @sureshanaparti nhận Xem trên GitHub
type:technical-debt
Ngôn ngữ chính
Java
Star
3.1k
Fork
1.4k
Merge trung bình
6 ngày 19 giờ
Pull request đã merge (30 ngày)
32

Mô tả

### problem

When checking job status of just created VM (creation should be already done) then it returns inconsistent jobstatus.

Here is example of response (irrelevant fields are omitted)

```json
{
"queryasyncjobresultresponse": {
"jobresult": {
"virtualmachine": {
"id": "eaa91396-811a-4db2-8ee8-91bb7c7b5d84",
"name": "x4ae6133a-908a-4ce5-8233-63dd93cc44d2",
"jobid": "35e2eb4c-7753-4d53-88ab-494ee1a8f296",
"jobstatus": 0
}
},
"jobid": "35e2eb4c-7753-4d53-88ab-494ee1a8f296",
"jobstatus": 1
}
}
```

So inside `virtualmachine` `"jobstatus": 0` (which means "in progress" and it is incorrect)
Outsite it is `"jobstatus": 1` which means "done" and it is correct.
These should be the same statuses - they have the same `jobid`

### versions

Cloudstack version 4.22
Hypervisor KVM

### The steps to reproduce the bug

1. Create vm using api `deployVM`
2. After VM is fully created use `queryAsyncJobResult` api call with `jobid` from `deployVM`
3. verify that `jobstatus` in both fields is the same

### What to do about it?

I think there are two solutions
1. Make `jobstatus` inside `virtualmachine` the same as outside. (I would prefer this option)
2. Remove `jobstatus` from inside `virtualmachine` when job is done. This way `listVirtualMachines` api is working, although it is confusing

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.