-
Notifications
You must be signed in to change notification settings - Fork 2
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
Long-running workflow with a promise is being unexpectedly suspended after 60 seconds #35
Comments
What you see there is not the workflow being cancelled, but being suspended. This is expected when the handler is waiting on some operation to make progress, and restate will resume the workflow back from the point where it left when it can make further progress! You can tune that "1 minute" timeout, making it larger, for all the services in the runtime tuning the |
You're absolutely right. However, how is it possible that with the same server configuration, TypeScript is not getting suspended? Additionally, I have a scenario where a service could potentially run for hours, days or even weeks. How should I handle this? Should I consider disabling the timeout entirely in such cases? When will the 1.2 be out then? |
I'm not 100% sure about this TBH, but it looks like the rust sdk is actually behaving correctly here. Could it be that the promise was already resolved? Or has been resolved within the 60 seconds time bound?
This is one of the features restate gives you, when waiting for days restate will close the physical request between your service and the restate server, and when the promise you await there will be resolved, restate will "resume" the request again from the point where it left. So you don't really need to do anything about it, Restate takes care of all of this for you! This blog post perhaps gives you a bit more details as well https://restate.dev/blog/we-replaced-400-lines-of-stepfunctions-asl-with-40-lines-of-typescript-by-making-lambdas-suspendable/ |
We don't know yet, probably beginning of next year |
Yeah that makes sense.
Nah, i don't think so. It's a similar implementation but only in ts. I have another use case involving jobs (workflows in Restate) that should never be suspended. These jobs function as subscriptions using an unbounded mpsc channel from Tokio, designed to run indefinitely until explicitly canceled by a user. Is it possible to set suspension limits to months or even years? Do you think that restate could handle this? Now or in 1.2? |
Have you considered using Restate's promises/awakeables for the same purpose? Or, have you considered subscribing to the mpsc channel from Tokio using an ad-hoc "regular tokio task", and then from there call the restate handler? Could you perhaps elaborate more your use case?
You can technically set any inactivity timeout you want, up to the max duration. But I'm not sure it makes sense to do so, because if the connection crashes and the handler replays, what would be the expected behavior on that subscription? |
I am using a promise in a long-running workflow to wait until it gets resolved or cancelled. However, the workflow in rust is consistently being cancelled exactly one minute after the workflow starts. The minimal script example in TypeScript (see the section at the bottom) worked as intended.
Error logs:
Minimal Reproduction Code
Here is a minimal code example to reproduce the issue
Restate SDK Version: 0.3
Steps to Reproduce
Rust (Not working)
Typescript (Working)
Restate on docker compose
The text was updated successfully, but these errors were encountered: