Admin task views show "waiting for an eligible worker" for expired tasks

Open
#56 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
fastapi, python
Domain
backend, testing

Research direction

Start with _awaiting_eligible_reason and the list and detail queries in server/orcaster_server/api/admin_ui.py, then check the expiry condition in server/orcaster_server/housekeeping.py. Trace how the task list and detail page render the waiting flag, and locate their tests. Done means expired tasks no longer show the flag in either view, future or unset expiries still do, tests cover both cases, and the Unreleased changelog includes an entry.

Written by the indexing model from the issue text.

Description

bug P2 server

Problem

The admin task list and the task detail page show "waiting for an eligible worker" for an all_available task in dispatching whose epoch has no execution. The flag does not look at expires_at (server/orcaster_server/api/admin_ui.py:553, and _awaiting_eligible_reason at server/orcaster_server/api/admin_ui.py:3511).

Housekeeping skips tasks whose expires_at has passed (server/orcaster_server/housekeeping.py:319). So for an expired task the promised wait never ends.

Steps to reproduce

  1. Create an all_available task with an expires_at in the past or soon, while no eligible worker is online.
  2. Wait until expires_at passes.
  3. Open the admin task list and the task detail page.
  4. The row still shows "waiting for an eligible worker" (server/orcaster_server/templates/_tasks_table.html:141).

Proposed change

Do not show the waiting flag when expires_at is set and in the past. Preferably show the task as expired instead, if the list already has a way to show that state. Apply the same rule to the list query and to the detail view (the detail query at server/orcaster_server/api/admin_ui.py:827 must then also return expires_at).

Acceptance criteria

  • The list row and the detail page do not show the waiting flag for a task whose expires_at is in the past.
  • Tasks without expires_at, or with one in the future, show the flag as before.
  • The condition matches the one used by housekeeping.
  • Tests cover an expired and a non-expired task in the list and in the detail view.
  • CHANGELOG entry under Unreleased.
Dominant language
Python
Stars
0
Forks
0
Avg merge
1d 1h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AInvirion/orcaster

All issues in AInvirion/orcaster

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.