This repository was archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
This repository was archived by the owner on Apr 24, 2023. It is now read-only.
/unscheduled_jobs inaccurately reports "You have 1 other jobs ahead in the queue." #908
Copy link
Copy link
Open
Labels
Description
Describe the bug
The /unscheduled_jobs endpoint inaccurately reports "You have 1 other jobs ahead in the queue.", despite the fact that the job it's referring to is already running.
To Reproduce
Steps to reproduce the behavior:
- Set your share to 1 cpu (not sure if this step is strictly necessary)
- Submit job
Awith priority=99, cpus=2, command=sleep 600and wait for it to start running - Submit job
Bwith priority=100, cpus=2, command=sleep 600and wait for it to start running - Submit job
Cwith priority=100, cpus=2, command=sleep 600 - Make a request to
/unscheduled_jobsfor jobC - Observe that it states that job
Bis "ahead in the queue" despite the fact thatBis running
Expected behavior
It should not report that running jobs are "ahead in the queue".
Additional context
$ cs jobs --user root --running --waiting
Cluster UUID Name Memory CPUs Priority Attempts Submitted Command Job Status
dev0 c9b7ef03-7df5-4c61-bebb-5f179890e14a default_test_job 256 MB 2 100 0 / 1 a minute ago sleep 600 Waiting
dev0 ed445d11-2629-4ba5-ac71-8b442b0e3997 default_test_job 256 MB 2 100 0 / 1 2 minutes ago sleep 600 Running
dev0 68794df5-0dfb-459a-a32a-732f2877e1e7 default_test_job 256 MB 2 99 0 / 1 2 minutes ago sleep 600 Running
$ curl localhost:12321/unscheduled_jobs?job=$uuid | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 379 0 379 0 0 20737 0 --:--:-- --:--:-- --:--:-- 21055
[
{
"uuid": "c9b7ef03-7df5-4c61-bebb-5f179890e14a",
"reasons": [
{
"reason": "The job would cause you to exceed resource shares.",
"data": {
"cpus": {
"limit": 1,
"usage": 6
}
}
},
{
"reason": "You have 1 other jobs ahead in the queue.",
"data": {
"jobs": [
"ed445d11-2629-4ba5-ac71-8b442b0e3997"
]
}
},
{
"reason": "The job is now under investigation. Check back in a minute for more details!",
"data": {}
}
]
}
]