Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow Status Capture Failure after Upgrade to v0.27.0 with Log Capture #57

Open
ArthurMor4is opened this issue Jun 20, 2024 · 1 comment

Comments

@ArthurMor4is
Copy link

Context:

I'm using the following step to check the status of new workflows:

@hatchet.step(parents=["features"])
async def wait_for_children(
    self, context: Context
):
    document_id = context.step_output("features")["document_id"]
    child_workflow_run_ids = context.step_output("features")["child_workflow_run_ids"]

    root_logger.info(f"Will wait for {len(child_workflow_run_ids)} child workflow runs to finish")
    results = []
    for id in child_workflow_run_ids:
        results.append(await hatchet.client.admin.get_workflow_run(id).result())

    is_done = all(result["finish_process_document"]["done"] is True for result in results)

    if not is_done:
        root_logger.error("Some child workflows could not finish.")
        raise Exception("Some child workflows could not finish.")

    return {"document_id": document_id, "child_workflow_run_ids": child_workflow_run_ids}

I was able to capture workflow statuses correctly using version 0.26.4 of the library. However, I tried to update to version 0.27.0 and use log capture according to the documentation at this link: https://docs.hatchet.run/sdks/python-sdk/logging

From then on, I can no longer capture the statuses correctly. I think the error in question is related to this commit: f42bcfb

All other steps in my workflow are synchronous

Bug error:

image

@abelanger5
Copy link
Contributor

Hey @ArthurMor4is, it looks like this is caused by a step returning something that is a coroutine. At first glance, this doesn't look related to logging, but could be due to some recent changes we made to the return values of spawn_workflow and run_workflow.

Is there any chance you could share the relevant code for the features step? Or share how you're calling spawn_workflow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants