hi everyone, I have a simple python script with ju...
# ask-community
p
hi everyone, I have a simple python script with just simple flow decorator and timeout_seconds parameter for 10sec applied to it but why my flow is working not as expected, it should give me output like TimeOutError but it won't can pls anyone tell me why won't it fail because I delayed it using sleep function Code here- """ from prefect import flow, task import time @flow(name="flow-for-timeout", timeout_seconds=10) def pls_get_timeout(): print("flow is started running") # sleep function of time module just used to make it delay of 20 second and then fail the flow time.sleep(20) print("I won't time out easily buddy") if name == "__main__": pls_get_timeout() """ Thanks for your help
b
Hi Praveen, thanks for your message. I tested your code in my own Prefect server and it TimedOut as expected.
I'd recommend confirming two things: • You have the latest version of Prefect installed • You have your server up and running in a separate machine (or terminal window) from where you're executing your flow run.
p
Hi Bianca, thanks for responding to my query and for that @Nate also responded and told this code also work in his system but I don't why it won't work on mine. I tried again but the result is same. From your recommendation I goes to those two option: • my prefect version is 2.14.15 • And yes I have separate terminal for localhost running prefect What have I tried until now? • I tried Prefect Cloud as well as localhost/self hosting for prefect flows runs • I wiped out all workspace of my Prefect cloud (if problem is in UI of cloud then there may be chance it wil work) • I also tried in my office desktop thinking it may work but problem remains same and TiimeOutErr didn't occur But until now nothing works and I don't know why build in parameter of flow decorator why don't perform as expected pls help