From e72340fc7d770b1a0ba5e33d24cee9c6ad69cc06 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Thu, 14 Dec 2023 14:17:00 +0100 Subject: [PATCH] Describe abort/inactivity timeouts --- docs/services/invocation.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/services/invocation.md b/docs/services/invocation.md index 392ef052..cb17651a 100644 --- a/docs/services/invocation.md +++ b/docs/services/invocation.md @@ -176,3 +176,15 @@ $ curl -X DELETE http://localhost:9070/invocations/T4pIkIJIGAsBiiGDV2dxK7PkkKnWy ``` For more details on the API, refer to the [admin API docs](/references/admin-api). + +## Invocation execution timeout(s) + +For each retry attempt, Restate internally holds an inactivity timer to track whether the service is active and generating some work, such as setting state, invoking other services, etc. This timer can be configured with the option [`worker.invoker.inactivity_timeout`](https://docs.restate.dev/restate/configuration). + +Once the `inactivity_timeout` is fired, Restate tries to gracefully suspend the invocation while waiting for an event that triggers the resumption of the invocation. +When suspending, the Restate SDK will continue executing the service code until it reaches a _suspension point_, that is a point in your service code where it's safe to interrupt the execution, for example when `await`ing on a response from another service. + +When suspending, Restate internally holds another timer to protect Restate from connection issues and/or misbehaving code/SDKs that prevent the tear down of the connection. This timer can be configured with the option [`worker.invoker.abort_timeout`](https://docs.restate.dev/restate/configuration). +Once the `abort_timeout` is fired, the user code is potentially interrupted, and all the subsequent progress is potentially lost. + +If you have [side effects](sdk/side-effects) that take more than `inactivity_timeout + abort_timeout` to execute, you might need to tune these timeouts accordingly, for example by increasing the `inactivity_timeout` to a value larger than the expected side effect duration.