fix(flytek8s): surface init-container waiting failures in DemystifyPending#7244
Merged
fix(flytek8s): surface init-container waiting failures in DemystifyPending#7244
Conversation
EngHabu
approved these changes
Apr 21, 2026
…nding Port of unionai/flyte#956 to v2. Fixes indefinite task hang when an init container is stuck (e.g. ImagePullBackOff on a missing init image, InvalidImageName, CreateContainerConfigError). demystifyPendingHelper now inspects InitContainerStatuses before ContainerStatuses, so the real init-container failure surfaces with the correct reason and per-reason grace-period handling. Previously, the main container's downstream Waiting{PodInitializing} masked the init-container failure; only the coarse PodPendingTimeout would eventually rescue the task. The waiting-reason switch is extracted into classifyWaitingContainer (byte-equivalent logic move, preserving v2's existing classification for CreateContainerError / CreateContainerConfigError past grace). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>
746349c to
8b9d01e
Compare
wild-endeavor
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ImagePullBackOffon a missing init image,InvalidImageName,CreateContainerConfigError).demystifyPendingHelpernow inspectsInitContainerStatusesbeforeContainerStatuses, so the real init-container failure surfaces with the correct reason and per-reason grace-period handling.Waiting{PodInitializing}masked the init-container failure; only the coarsePodPendingTimeoutwould rescue the task, with a generic "timeout expired" message.Root cause
flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go— thePodReady == Falsebranch ofdemystifyPendingHelperonly iteratedstatus.ContainerStatuses.DemystifySuccessandDemystifyFailurealready walkInitContainerStatuses; only the pending path was inconsistent.Scope
classifyWaitingContainer(logic move, preserving v2's existing classification — v2 usesPhaseInfoFailureWithCleanupforCreateContainerError/CreateContainerConfigErrorpast grace, which differs from v1's retryable variants).PodReady.LastTransitionTime).DemystifyPending,PodPendingTimeout, or pluginGetTaskPhase.Test plan
go build ./flyteplugins/go/tasks/pluginmachinery/flytek8s/...go test ./flyteplugins/go/tasks/pluginmachinery/flytek8s/... -run TestDemystifyPending -v— 16 pre-existing subtests unchanged + 9 new init-container subtests greengo test ./flyteplugins/go/tasks/pluginmachinery/flytek8s/...— full package PASSgo test ./flyteplugins/go/tasks/plugins/k8s/pod/...— caller path PASSRefs
🤖 Generated with Claude Code
main