https://prefect.io logo
d

Deceivious

07/27/2023, 8:14 AM
Hello everyone, retrying a simple flow with subflows with no result storage causes error (MissingResult). Is this expected?
1
Replication code
Copy code
import prefect
from prefect import flow
from prefect.deployments.deployments import Deployment

@flow
def success():
    prefect.get_run_logger().info("a")


@flow
def fail():
    prefect.get_run_logger().info("b")


@flow
def main_flow():
    prefect.get_run_logger().info("c")
    success()
    fail()


if __name__ == "__main__":
    Deployment.build_from_flow(flow=main_flow, name="test_flow", apply=True)
Create a flow run using the deployment page on an agent. Once the flow run is completed, retry the same flow run using the UI. The retry should fail with a Missing Result error.
Reping for attentions
c

Christopher Boyd

07/28/2023, 12:51 PM
Hey Deceivious, result_persistence is turned off by default, and there is no code in your repro that toggles it on
d

Deceivious

07/28/2023, 12:53 PM
@Christopher Boyd But my code does not require the result.
Copy code
The persist_result option defaults to a null value, which will automatically enable persistence if it is needed for a Prefect feature used by the flow or task.
Also according to docs
c

Christopher Boyd

07/28/2023, 12:55 PM
Maybe I misunderstand your problem : • There is no result persistence on the flow • Default result persistence is disable • You get a MissingResult error when you retry
what is the expected outcome here?
retrys require results
d

Deceivious

07/28/2023, 12:57 PM
I would expect the result to be retrieved only if it is being used.
c

Christopher Boyd

07/28/2023, 12:57 PM
What’s the point of retrying then, instead of just running a new flow?
Retrying is implicitly saying use results
d

Deceivious

07/28/2023, 12:59 PM
Say one of my sub flows failed. I have 17 of them . Id want to skip the 16 of them and retry the 1 that has failed. My sub flows do not return anything. I would expect the 16 subflows; state to be checked ie Completed and the ones that Failed would be retried.
c

Christopher Boyd

07/28/2023, 1:00 PM
Are results persisted for any of them? Parent flow or subflows?
d

Deceivious

07/28/2023, 1:01 PM
No result persisted for any of them. All the results are None.
c

Christopher Boyd

07/28/2023, 1:02 PM
I’ll check with the team and see if there is any other feedback - this seems like expected behavior to me , but I could be wrong
d

Deceivious

07/28/2023, 1:03 PM
Thanks @Christopher Boyd
My concern with this approach is: 1. I am using a distributed agent ie. multiple agents in multiple machines on the cloud. 2. My code has no returns ie all of them return
None
3. Id say it would be weird if I had to allocate a shared remote storage infrastructure to store those `None`s in esp. as the results are not being used at all. The status of the subflows are in Prefect database.
Hi @Christopher Boyd, Any update on this?
c

Christopher Boyd

07/31/2023, 12:23 PM
I checked in with the team - the expectation here is that this is as expected. If you want something to be retryable, results need to be persisted
d

Deceivious

07/31/2023, 1:05 PM
Thanks.