Do Agents submit separate flow runs to the Executor in a depth-first or breadth-first pattern? I’m wondering if Prefect gives priority to task B of the 1st flow run (“1B”) over the task A of the 2nd flow run (“2A”).
Jack Sundberg
03/04/2021, 4:11 PM
Or is task 1B submitted to the Executor only after it’s Trigger is hit? I think this would lead to a race-condition for which task runs first (1B or 2A).
z
Zanie
03/04/2021, 4:11 PM
Hey @Jack Sundberg -- the Agent submits a flow then returns to querying for flows. They do not manage tasks at all.
Zanie
03/04/2021, 4:12 PM
Between Flow 1 and Flow 2 there is no coordination of task submission to an executor.
j
Jack Sundberg
03/04/2021, 4:14 PM
Gotcha, makes sense. For the core logic then (flow.run), is my 2nd statement above correct? Specifically a task is sent to the executor when the Trigger is hit (?)
z
Zanie
03/04/2021, 4:17 PM
Yes I believe so, otherwise we'd flood dask with a bunch of sleeping tasks.
Zanie
03/04/2021, 4:19 PM
We may submit a helper function to the executor when all of the upstream tasks for a task are completed that then checks the trigger and executes the real task or fails but I'm not sure if a case where this would affect you.
j
Jack Sundberg
03/04/2021, 4:21 PM
Okay, I just wanted to make sure flow.run() doesn't submit "delayed" tasks (like Dask.delayed).
Jack Sundberg
03/04/2021, 4:22 PM
and interesting... that doesn't affect me at the moment, but is good to know. Thanks!
z
Zanie
03/04/2021, 4:33 PM
flow.run
would submit dask delayed tasks if your executor is a
DaskExecutor
j
Jack Sundberg
03/04/2021, 4:39 PM
yep! to clarify, I meant whether the full dask.delayed dag (so all flow tasks and logic) is submitted upfront to Executor, as opposed to only submitting tasks to the Executor when their Triggers indicate they are ready. Sounds like the latter is the actual Prefect case. Sorry for the confusion.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.