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] subworkflow timeout propagation #4766

Merged
merged 5 commits into from
Jan 24, 2024

Conversation

pvditt
Copy link
Contributor

@pvditt pvditt commented Jan 23, 2024

Tracking issue

#4087
#4765

Why are the changes needed?

  • When a subworkflow's task fails due to reaching node-active-deadline, the workflow does not fail. The workflow continues to run after the timed out task gets aborted and getting set to "UNKNOWN" state

  • When a task time's out due to reaching node-active-deadline, the task's status gets set to "UNKNOWN"

What changes were proposed in this pull request?

  • Have subworkflows handle TimedOut state

  • Transform EPhaseTimedout -> NodeExecution_TIMED_OUT when creating node execution events

How was this patch tested?

Ran a couple workflows. Would be a decent effort to add unit testing - can add if needed.

Setup process

Test subworkflow timeout propagation (will hit node-active-deadline on retry)

@task(
    timeout=timedelta(seconds=10),
    retries=1,
)
def demo_task():
    time.sleep(3000)



@task
def demo_task_1():
    time.sleep(3000)


@workflow
def subworkflow():
    demo_task()
    demo_task_1()


@workflow
def demo_workflow():
    subworkflow()

To isolate test to persisting aborted node on TimeOut:

Set node-active-deadline to small value in Flyte config:

propeller:
    node-config:
        default-deadlines:
            node-active-deadline: 10s
@task(
   retries=1,
)
def demo_task():
   time.sleep(3000)


@workflow
def demo_workflow():
   demo_task()

Screenshots

image

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 changed the title Bug/subworkflow timeout propagation [BUG] subworkflow timeout propagation Jan 23, 2024
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (73b1d40) 58.21% compared to head (f011b15) 58.20%.
Report is 5 commits behind head on master.

Files Patch % Lines
...er/pkg/controller/nodes/subworkflow/subworkflow.go 0.00% 16 Missing ⚠️
...lytepropeller/pkg/controller/nodes/transformers.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4766      +/-   ##
==========================================
- Coverage   58.21%   58.20%   -0.01%     
==========================================
  Files         626      626              
  Lines       53855    53911      +56     
==========================================
+ Hits        31349    31377      +28     
- Misses      19996    20023      +27     
- Partials     2510     2511       +1     
Flag Coverage Δ
unittests 58.20% <0.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 marked this pull request as ready for review January 23, 2024 21:44
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 23, 2024
@pvditt pvditt requested a review from hamersaw January 23, 2024 21:44
@dosubot dosubot bot added the bug Something isn't working label Jan 23, 2024
@pvditt pvditt force-pushed the bug/subworkflow-timeout-propagation branch from 0037b29 to f011b15 Compare January 24, 2024 07:19
@pvditt pvditt requested a review from hamersaw January 24, 2024 07:30
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 24, 2024
@pvditt pvditt merged commit 047924d into master Jan 24, 2024
42 of 45 checks passed
@pvditt pvditt deleted the bug/subworkflow-timeout-propagation branch January 24, 2024 18:42
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:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants