apache / apache/cloudstack

Management Server Jobs Pending View Incorrect

Open
#11,056 4 comments 0 reactions 0 assignees View on GitHub
long-term-plan status:needs-reproducing
Dominant language
Java
Stars
3.1k
Forks
1.4k
Avg merge
6d 19h
Merged PRs (30d)
32

Description

### problem

The Management Server Jobs Pending view in the UI is showing ALL jobs in the async_job table for the management server id, not just those with pending status. This is due to the fact that the API call does not have an option to filter by job status, and the UI logic/view does not filter out non-pending jobs.

![Image](https://github.com/user-attachments/assets/009e2966-0696-427e-8917-a1a9f0e6a5db)

### versions

This was found in Cloudstack 4.19.0.1, but appears to be present in all later versions as well.

### The steps to reproduce the bug

1. Perform actions that cause async jobs to run (AttachVolume for example).
2. Once jobs are complete (job_status=1 or job_status=2 in database), view the management server's Pending Jobs tab.

### What to do about it?

This could be fixed in several ways:

1. Async job api updated to take a filter for job status and UI updated to provide it as input (better performance)
2. UI updated to filter the response data based on job status (could degrade if # of jobs becomes large)
3. UI enhanced to show job status data for the user (and maybe details when a job fails, for example).

Contributor guide

Open the contributing guide

Research direction

Start with the Management Server Jobs Pending view and the async job API, then reproduce the issue using completed jobs in async_job with job_status 1 or 2. Decide which proposed filtering approach fits the project and verify that the Pending Jobs tab shows only jobs with pending status without hiding genuinely pending jobs.

Written by the indexing model from the issue text.

Assessment

Domain
api, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.