I'm trying to timeout a task within a map_task, an...
# flyte-support
a
I'm trying to timeout a task within a map_task, and it appears that any timeout fails the workflow without respect to min_successes (or ratio). ex:
Copy code
@task(timeout=10)
def sleep_task(sleep_duration: int) -> int:
    sleep(sleep_duration)
    return sleep_duration

@workflow
def map_task_timeout_wf() -> int:
    items = generate_list(list_size=10, min=5, max=15)
    values = map_task(target=sleep_task, concurrency=3, min_successes=1)(
        sleep_duration=items
    )
    result: int = sum_data(values=values)
    return result
Where the above should fail about 50% of tasks (sleeping between 5 and 15 seconds on a 10 second timeout). The moment 1 fails, the workflow fails with
Copy code
[1]: [1/1] currentAttempt done. Last Error: USER::task execution timeout [10s] expired
Is this intended? Is there a workaround?
c
I believe that is intended. Have you tried using failure policies? I can't find the docs for them but its along these lines
Copy code
@fl.workflow(
    # The workflow remains unaffected if one of the nodes encounters an error, as long as other executable nodes are still available
    failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE
)