any experience running prefect flows with uv hangi...
# ask-community
k
any experience running prefect flows with uv hanging? it seems to start the uv run, and then hangs
uv run python -m prefect.engine
i know it's trying to run the flow because if the script is not there it throws an error. but it never actually executes my flow.
n
hi @Kevin Hu - i've overriden the command like that for one reason or another over time and haven't hit hanging issues do you have a self-contained example?
k
i shouldve added more details. i have a fargate service for the worker, and it runs the flows as a task (just following the ecs worker guide). for some reason it just hangs in the flow run. i did a test where i started a prefect-docker worker on a separate ec2 machine, redeployed my flow for that pool, and the flow runs work fine. the images are pulled, ran on the docker worker, and complete in seconds.
n
so its probably not about uv then right? its probably something ECS related?
k
yeah im guessing it's something related to ecs. but the odd thing is i simplified my flow to something very basic, and ive seen it pass a few times (<10% of times).
Copy code
from prefect import flow
from prefect.logging import get_run_logger


@flow
def test_flow():
    logger = get_run_logger()
    <http://logger.info|logger.info>("Hello from ECS!!")


if __name__ == "__main__":
    test_flow()
i bumped the memory and cpu up and still no improvement.
n
is there resource scarcity in your cluster or something?
k
no there shouldnt be it's a sandbox account and it's the only thing running in the cluster.
n
hmm not immediately sure then with the given info
k
yeah i understand im not offering a lot to work with here.
just closing the loop here. after much debugging it turns out the flow was hanging because of the websocket connection. after it timed out (30 mins?) it threw an error. i have no idea why this works for another test flow i have but not the ones in this uv project. setting
PREFECT_API_ENABLE_HTTP2
to false makes it work now.
n
huh - that is odd would you be willing to codify this as a discussion?