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

[BUG] handle potential uncaught OOMKilled terminations #4793

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

pvditt
Copy link
Contributor

@pvditt pvditt commented Jan 30, 2024

Tracking issue

#4704

Why are the changes needed?

Propeller doesn't always fail OOMKilled pods as OOMKilled.

What changes were proposed in this pull request?

Catch potential OOMKilled errors that have a ExitCode: 0 + enrich error messages to mark error as OOMKilled.

Will follow up with a PR to enrich other error messages.

How was this patch tested?

  • added unit test
  • ran workflow

Setup process

import subprocess

from flytekit import Resources, task, workflow
from flytekit.core.workflow import WorkflowFailurePolicy


@task(requests=Resources(mem="500Mi"))
def subproc_oom():
    try:
        subprocess.run(["tail", "/dev/zero"], check=True)
    except subprocess.CalledProcessError as e:
        print(f"Return code {e.returncode}")
        raise e


@task(requests=Resources(mem="500Mi"))
def other_oom():
    l = []
    while True:
        l.append('a' * 10**6)


@workflow(
    failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE
)
def workflow():
    subproc_oom()
    other_oom()

Screenshots

Screenshot 2024-01-29 at 11 02 50 PM

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

@pvditt pvditt marked this pull request as ready for review January 30, 2024 07:19
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jan 30, 2024
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (abef3f5) 58.54% compared to head (87dbc09) 58.56%.
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4793      +/-   ##
==========================================
+ Coverage   58.54%   58.56%   +0.01%     
==========================================
  Files         625      624       -1     
  Lines       53669    53600      -69     
==========================================
- Hits        31423    31391      -32     
+ Misses      19731    19692      -39     
- Partials     2515     2517       +2     
Flag Coverage Δ
unittests 58.56% <100.00%> (+0.01%) ⬆️

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.

@pvditt pvditt requested a review from hamersaw January 30, 2024 17:32
Copy link
Contributor

@EngHabu EngHabu left a comment

Choose a reason for hiding this comment

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

Nice!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 30, 2024
@pvditt pvditt merged commit a2dbe49 into master Jan 30, 2024
45 checks passed
@pvditt pvditt deleted the bug/uncaught-oom-killed branch January 30, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants