Skip to content

Split pending-worker checks out of task status polling - #120

Merged
yoonspark merged 1 commit into
mainfrom
refactor/separate-pending-worker-check
Aug 18, 2026
Merged

Split pending-worker checks out of task status polling#120
yoonspark merged 1 commit into
mainfrom
refactor/separate-pending-worker-check

Conversation

@yoonspark

Copy link
Copy Markdown
Collaborator

Summary

  • Move the pending-worker check out of _check_task_status into its own _check_pending_workers step in the tracking cycle, which stops warning about pending workers during shutdown
  • Rename _handle_task_timeout to _resubmit_if_timed_out, since the name should say it resubmits
  • Add test_tracking_cycle_checks_pending_workers so dropping the new step from _run_tracking_cycle fails a test rather than silently disabling the warning

`_check_pending_workers` ran inside the Slurm branch of `_check_task_status`,
coupling queue-warning bookkeeping to status polling. It now owns its task
loop and runs as its own tracking-cycle step.

That also stops the warnings during shutdown: `_drain_tasks` polls status in
a loop, so it used to query the queue every second and could log pending
warnings while tasks were still exiting.

Rename `_handle_task_timeout` to `_resubmit_if_timed_out` and move its
ordering constraint into its own docstring, next to the code that depends
on it.

Drop the status-polling mocks the pending-worker tests only needed to reach
the check through `_check_task_status`, and add a cycle-level test so the
new step cannot be dropped from `_run_tracking_cycle` unnoticed.
@yoonspark yoonspark added refactor Make code cleaner, clearer, and easier to understand enhancement Polish, improve, or tweak existing behavior labels Aug 17, 2026
@yoonspark
yoonspark merged commit 99014fa into main Aug 18, 2026
8 checks passed
@yoonspark
yoonspark deleted the refactor/separate-pending-worker-check branch August 18, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Polish, improve, or tweak existing behavior refactor Make code cleaner, clearer, and easier to understand

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant