acoustic-carpenter-78188
11/08/2023, 3:43 PMFAIL_AFTER_EXECUTABLE_NODES_COMPLETE workflow failure policy, we observed a truly peculiar bug:
A node which should never be tried to execute as it depends on an already failed (dynamic) task, is not correctly skipped but can't be started and fails after 50 retries with:
Workflow[...] failed. RuntimeExecutionError: max number of system retry attempts [51/50] exhausted. Last known status message: Failed to check Catalog for previous results: failed to read inputs when trying to query catalog: [READ_FAILED] failed to read data from dataDir [.../inputs.pb]., caused by: path:gs://.../inputs.pb: not found
from
flyte/flytepropeller/pkg/controller/nodes/cache.go
Line 96 in </flyteorg/flyte/commit/feeda193f285116a207342d17b173217650f3b0a|feeda19>
* * *
A minimal example:
from flytekit import WorkflowFailurePolicy, dynamic, task, workflow
CACHE = "0.0.25" # Bumping cache between retries
USE_CACHE = True # Bug only occurs with active caching
@task(cache=USE_CACHE, cache_version=CACHE)
def my_task(number: int, will_fail: bool) -> int:
if will_fail:
raise Exception("Failure")
return number + 1
@dynamic
def dyn_task(will_fail: bool) -> int:
return my_task(number=42, will_fail=will_fail)
@workflow(failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE)
def main():
result1 = dyn_task(will_fail=False)
# This dyn_task is never started although it should be due to the failure policy
my_task(number=result1, will_fail=False) # <- This is stuck in `Unknown`
result2 = dyn_task(will_fail=True)
# This my_task should never be executed as it depends on the dyn_task above which will fail
my_task(number=result2, will_fail=True) # <- This is stuck in `Unknown` and causes the cache check error after 50 retries
image
Expected behavior
@workflow(failure_policy=WorkflowFailurePolicy.FAIL_AFTER_EXECUTABLE_NODES_COMPLETE)
def main():
result1 = dyn_task(will_fail=False)
# Should be executed
my_task(number=result1, will_fail=False)
result2 = dyn_task(will_fail=True)
# Should be marked as `Skipped`
my_task(number=result2, will_fail=True)
Additional context to reproduce
We debugged this with flyte 1.10.0 but we believe we have seen this already before.
Screenshots
No response
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyteacoustic-carpenter-78188
12/06/2023, 4:36 PM