https://prefect.io logo
Title
z

Zac Hooper

12/06/2022, 11:35 PM
I have a flow that is occasionally failing with the following error: State message: Given states: total=2, not_final=2, 'RUNNING'=1, 'PENDING'=1. Both of the tasks in the flow finish as completed as seen in the photo. The flow's code looks like this:
@task
def prod_9e_etl_asx_anns():
    logger = get_run_logger()
    res = invoke_lambda("prod_9e_etl_asx_anns", {}, True)
    <http://logger.info|logger.info>(res)
    return ""


@task
def prod_9e_etl_asx_ann_sentiment():
    logger = get_run_logger()
    res = invoke_lambda("prod_9e_etl_asx_ann_sentiment", {}, True)
    <http://logger.info|logger.info>(res)
    return ""


@flow(task_runner=SequentialTaskRunner(), retries=2)
def perfom_asx_anns_etl():
    x = prod_9e_etl_asx_anns.submit(return_state=True)
    y = prod_9e_etl_asx_ann_sentiment.submit(wait_for=[x])
I need to make sure the tasks happen in sequential order. Any idea how I prevent this error?