i

    itay livni

    1 year ago
    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

    [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
    nicholas

    nicholas

    1 year ago
    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

    1 year ago
    @nicholas How do you check if it's taking up resources?
    Dylan

    Dylan

    1 year ago
    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?
    i

    itay livni

    1 year ago
    @Dylan I dont see an end_time. But maybe you can point me where to look.
    @Dylan This doesn't seem right:
    [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.
    Dylan

    Dylan

    1 year ago
    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

    1 year ago
    Ok. Any next steps on my part?
    Dylan

    Dylan

    1 year ago
    @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

    1 year ago
    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
    nicholas

    nicholas

    1 year ago
    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