Repository navigation
Description
Description
TES 1.1 adds two states and narrows one:
CANCELED: cancelled, and downstream resources have been deleted;CANCELING: cancelled, resources still awaiting deletion;PREEMPTED: stopped by the system to reclaim compute capacity.
TESK API reports CANCELED as soon as the taskmaster's job has the cancel
label (TaskStateResolver.java:52-54), while the taskmaster still stops the
running executor, and a task cancelled before its taskmaster ran can keep its
executor running. Cancelling such a task again patches it again
(Constants.java:105-110, TesServiceImpl.java:321-350). Executors that
Kubernetes preempts or evicts make the task EXECUTOR_ERROR
(TaskStateResolver.java:64-66, docs/index.md:130-133). TesState has
neither new value (TesState.java:10-28).
Proposal: CANCELING while the task is labelled cancelled and any of its
jobs (taskmaster, executors, outputs filer) has an active or pending pod;
CANCELED once none has. PREEMPTED for a failed executor job whose pod has
the condition DisruptionTarget=True (Kubernetes 1.26+) with the reason
PreemptionByScheduler.
Open question: should node shutdown (TerminationByKubelet), taints
(DeletionByTaintManager) and drains (EvictionByEvictionAPI) also count
as PREEMPTED? The specification ties it to the system reclaiming capacity;
recommendation: yes for all four, since the executor's command didn't fail,
and keep EXECUTOR_ERROR for pods without that condition.
Expected result
-
TesStatehasCANCELINGandPREEMPTED - A cancelled task is
CANCELINGuntil none of its jobs has an active or pending pod, thenCANCELED - Cancelling a
CANCELINGtask answers200 OKand patches nothing - A task whose executor pod failed with
DisruptionTarget(reasons as decided) isPREEMPTED, notEXECUTOR_ERROR -
TaskStateResolverTest's decision table covers the new rules -
docs/index.md(state rules, "Cancelling a task", the eviction paragraph) updated
Activity