https://prefect.io logo
i

itay livni

02/22/2021, 5:13 PM
Hi - I am trying to debug a flow with a case statement inside apply_map. • Although no errors are being raised, the case statement seems to be running twice with only one mapped task to complete. • The other issue I am seeing is
SKIP signal raised: SKIP('Provided value "True" did not match "False"')
. • In prefect cloud the
case
statement continues to run indefinitely even though the flow has terminated. ## Logs
Copy code
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)': Starting task run...
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)': Finished task run for task with final state: 'Mapped'
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)[0]': Starting task run...
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)[0]': Finished task run for task with final state: 'Success'
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(False)': Starting task run...
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(False)': Finished task run for task with final state: 'Mapped'
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(False)[0]': Starting task run...
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | SKIP signal raised: SKIP('Provided value "True" did not match "False"')
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(False)[0]': Finished task run for task with final state: 'Skipped'
Any thoughts on what is going on here. Thanks
n

nicholas

02/22/2021, 5:16 PM
Hi @itay livni - when you say the task is running indefinitely, do you mean it's taking up resources indefinitely or the UI is not showing it as ending? It's possible this is just the UI not being able to read an ending timestamp for the task run
i

itay livni

02/22/2021, 5:19 PM
@nicholas How do you check if it's taking up resources?
d

Dylan

02/22/2021, 5:20 PM
I believe most of the behavior here is expected (based on the above logs): 1. the case statement where the case ==
True
maps one task which succeeds 2. the case statement where the case ==
False
maps one run, which then raises a SKIP signal because the case doesn’t match 3. the mapped task that appears to run indefinitely has a log confirming that it ends
It does look like one of the mapped case statements isn’t properly setting an
end_time
with
apply_map
?
Can you confirm that the mapped task that’s running over in the UI doesn’t have an
end_time
@itay livni?
👀 1
i

itay livni

02/22/2021, 5:25 PM
@Dylan I dont see an end_time. But maybe you can point me where to look.
@Dylan This doesn't seem right:
Copy code
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)': Starting task run...
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)': Finished task run for task with final state: 'Mapped'
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)[0]': Starting task run...
[2021-02-22 08:49:04-0600] INFO - prefect.TaskRunner | Task 'case(True)[0]': Finished task run for task with final state: 'Success'
The case task is running twice. Where I expect it only to be run once.
d

Dylan

02/22/2021, 5:44 PM
So it’s running once, the first time it’s generating all of the mapped runs, which is why it ends in a mapped state
The second run is the child run
which finishes in a successful state
@itay livni The fact that the mapped task doesn’t have an end time appears to be a bug this appears to be standard on further reflection
i

itay livni

02/22/2021, 5:47 PM
Ok. Any next steps on my part?
d

Dylan

02/22/2021, 5:48 PM
@nicholas Do you think this is a UI bug?
@itay livni a reproducible example (i.e. Prefect Core code) would be helpful. I do think we want to fix the UI view
Thank you!
i

itay livni

02/22/2021, 5:51 PM
Ok. I'll try to put something together. There is some bug. A flow from yesterday still shows the skipped case statement running
@nicholas Quick update. I changed the
case
statement to an
ifelse
same behavior concerning the UI
n

nicholas

02/22/2021, 6:25 PM
Thanks for confirming @itay livni - I'll open a ticket to fix that in the UI
Just to follow up, I've opened a ticket here: https://github.com/PrefectHQ/ui/issues/626
👍 1