Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pod template override error #6224

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

arbaobao
Copy link
Contributor

@arbaobao arbaobao commented Feb 6, 2025

Tracking issue

#5683

Why are the changes needed?

An error occurs when running a workflow because of this error.

Workflow[flytesnacks:development:dynamic.dynamic_wf] failed. RuntimeExecutionError: max number of system retry attempts [11/10] exhausted. Last known status message: failed at Node[n0]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [container]: nil Struct Object passed
Screenshot 2025-02-06 at 11 07 01 AM

What changes were proposed in this pull request?

Accessing PodTemplate correctly.

How was this patch tested?

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

This PR addresses a critical workflow execution error by implementing proper pod template validation. The fix modifies pod helper logic to ensure safe PodSpec access, preventing system retry exhaustion errors. The change introduces additional nil checks to prevent potential crashes.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 1

Signed-off-by: Nelson Chen <[email protected]>
@flyte-bot
Copy link
Collaborator

flyte-bot commented Feb 6, 2025

Code Review Agent Run #bbe101

Actionable Suggestions - 1
  • flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go - 1
    • Potential nil pointer dereference in podTemplate · Line 292-292
Review Details
  • Files reviewed - 1 · Commit Range: 67a64c9..67a64c9
    • flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go
  • Files skipped - 0
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

AI Code Review powered by Bito Logo

@flyte-bot
Copy link
Collaborator

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Bug Fix - Pod Template Access Fix

pod_helper.go - Fixed pod template access by checking PodSpec directly instead of using GetOverrides

@@ -289,7 +289,7 @@ func BuildRawPod(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v

// handle pod template override
podTemplate := tCtx.TaskExecutionMetadata().GetOverrides().GetPodTemplate()
if tCtx.TaskExecutionMetadata().GetOverrides().GetPodTemplate() != nil {
if podTemplate.GetPodSpec() != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential nil pointer dereference in podTemplate

Consider checking if podTemplate is not nil before accessing its methods. The current code could panic if podTemplate is nil.

Code suggestion
Check the AI-generated fix before applying
Suggested change
if podTemplate.GetPodSpec() != nil {
if podTemplate != nil && podTemplate.GetPodSpec() != nil {

Code Review Run #bbe101


Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.86%. Comparing base (7dfe7d4) to head (67a64c9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6224   +/-   ##
=======================================
  Coverage   36.85%   36.86%           
=======================================
  Files        1318     1318           
  Lines      134534   134534           
=======================================
+ Hits        49586    49592    +6     
+ Misses      80627    80621    -6     
  Partials     4321     4321           
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 51.94% <ø> (+0.02%) ⬆️
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (ø)
unittests-flyteidl 7.23% <ø> (ø)
unittests-flyteplugins 53.91% <100.00%> (ø)
unittests-flytepropeller 42.78% <ø> (ø)
unittests-flytestdlib 55.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Future-Outlier Future-Outlier changed the title [fixed]Fix workflow execute error fix pod template override error Feb 6, 2025
@Future-Outlier Future-Outlier merged commit 66d7257 into flyteorg:master Feb 6, 2025
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants