<#7293 fix(v2): preserve terminal phase on TaskAct...
# flyte-github
a
#7293 fix(v2): preserve terminal phase on TaskAction delete events Pull request opened by pingsutw Why are the changes needed? Successful (and failed) runs were flipping to Aborted in the UI some time after completion, even without restarting devbox — most reproducibly after the laptop slept and woke. •
DeleteFunc
fires for both real deletes and
DeletedFinalStateUnknown
tombstones (delivered when the informer missed events during a watch gap, e.g. sleep/resume). •
buildActionUpdate
then unconditionally overwrote
phase
with
ABORTED
for any delete event, even for TaskActions that had already reached `Succeeded`/`Failed`. •
notifyRunService
pushed that ABORTED phase to the run service, overwriting the recorded terminal status in the DB → UI shows Aborted. The pre-existing
labelTerminalStatusRecorded
guard (
shouldSkipTaskAction
) was only consulted by `AddFunc`/`UpdateFunc`, never by
DeleteFunc
. What changes were proposed in this pull request? Two guards in `actions/k8s/client.go`: 1.
DeleteFunc
now calls
shouldSkipTaskAction
after unwrapping the tombstone, so deletes for actions already labeled
terminal-status-recorded
are dropped before dispatch. 2.
buildActionUpdate
only forces
ABORTED
when the current phase is not terminal. This preserves `Succeeded`/`Failed`/`TimedOut` for legitimate post-terminal CR cleanup as well. How was this patch tested?
go test ./actions/k8s/... -count=1
— passes. New unit tests in `actions/k8s/client_test.go`: •
TestBuildActionUpdate_DeleteAfterTerminalPreservesPhase
— Succeeded and Failed cases (the bug scenario). •
TestBuildActionUpdate_DeleteOnNonTerminalForcesAborted
— confirms in-flight deletes still produce ABORTED. Labels • fixed Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs flyteorg/flyte