acoustic-carpenter-78188
07/13/2026, 7:33 PMTaskAction can transition through several phases (e.g. QUEUED -> RUNNING -> SUCCEEDED) before the actions client drains its watch queue. Processing each queued event independently issues a redundant RunService update (and a k8s label patch) per intermediate phase, when only the latest phase matters.
2. Wrong action duration. Action created_at was stamped when the actions client first recorded the action, not when the action actually started, so durations rendered as <1s instead of the true elapsed time.
What changes were proposed in this pull request?
1. Key-based coalescing (actions/k8s/client.go): dedupe pending watch events by TaskAction name in a global pending set; the worker reads the latest object from the shared cache instead of a stale snapshot, so multiple queued transitions collapse into a single RunService update reflecting the current phase. Deletes bypass coalescing.
2. Record the true action start: pass the CRD creationTimestamp as `ActionStatus.start_time`; UpdateActionPhase (runs/repository/impl/action.go, interface + mocks + internal_run_service.go) uses LEAST(created_at, start) to correct created_at and compute an accurate duration — no proto change required.
How was this patch tested?
• Unit tests added: actions/k8s/client_test.go — coalescing collapses same-key events and emits a single terminal RunService update (TestDispatchEvent_CoalescesUpdatesForSameKey, TestHandleWatchEvent_CoalescedReadsLatestPhase); runs/repository/impl/action_test.go — start_time corrects duration and nil start falls back to created_at.
• Regenerated repository mocks (mockery).
Labels
fixed
Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
flyteorg/flyteacoustic-carpenter-78188
07/13/2026, 7:33 PMacoustic-carpenter-78188
07/14/2026, 6:16 AM