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

Describe abort/inactivity timeouts #218

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/services/invocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,15 @@
```

For more details on the API, refer to the [admin API docs](/references/admin-api).

## Invocation execution timeout(s)

Check failure on line 180 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L180

[Google.OptionalPlurals] Don't use plurals in parentheses such as in 'timeout(s)'.
Raw output
{"message": "[Google.OptionalPlurals] Don't use plurals in parentheses such as in 'timeout(s)'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 180, "column": 25}}}, "severity": "ERROR"}

Check notice on line 180 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L180

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 180, "column": 32}}}, "severity": "INFO"}

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).

Check notice on line 182 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L182

[write-good.E-Prime] Try to avoid using 'is'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'is'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 182, "column": 99}}}, "severity": "INFO"}

Check notice on line 182 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L182

[Google.Passive] In general, use active voice instead of passive voice ('be configured').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be configured').", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 182, "column": 203}}}, "severity": "INFO"}

Check warning on line 182 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L182

[write-good.Passive] 'be configured' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'be configured' may be passive voice. Use active voice if you can.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 182, "column": 203}}}, "severity": "WARNING"}

Check notice on line 182 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L182

[write-good.E-Prime] Try to avoid using 'be'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'be'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 182, "column": 203}}}, "severity": "INFO"}

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.

Check warning on line 184 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L184

[write-good.Passive] 'is fired' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'is fired' may be passive voice. Use active voice if you can.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 184, "column": 31}}}, "severity": "WARNING"}

Check notice on line 184 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L184

[Google.Passive] In general, use active voice instead of passive voice ('is fired').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is fired').", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 184, "column": 31}}}, "severity": "INFO"}

Check notice on line 184 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L184

[write-good.E-Prime] Try to avoid using 'is'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'is'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 184, "column": 31}}}, "severity": "INFO"}

Check warning on line 184 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L184

[write-good.Weasel] 'gracefully' is a weasel word!
Raw output
{"message": "[write-good.Weasel] 'gracefully' is a weasel word!", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 184, "column": 58}}}, "severity": "WARNING"}
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.

Check warning on line 185 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L185

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 185, "column": 34}}}, "severity": "WARNING"}

Check notice on line 185 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L185

[Google.Contractions] Use 'that's' instead of 'that is'.
Raw output
{"message": "[Google.Contractions] Use 'that's' instead of 'that is'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 185, "column": 114}}}, "severity": "INFO"}

Check notice on line 185 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L185

[write-good.E-Prime] Try to avoid using 'is'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'is'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 185, "column": 119}}}, "severity": "INFO"}

Check notice on line 185 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L185

[write-good.E-Prime] Try to avoid using 'it's'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'it's'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 185, "column": 157}}}, "severity": "INFO"}

Check failure on line 185 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L185

[Vale.Spelling] Did you really mean 'ing'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'ing'?", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 185, "column": 219}}}, "severity": "ERROR"}

When suspending, Restate internally starts 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).

Check warning on line 187 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L187

[write-good.Passive] 'be configured' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'be configured' may be passive voice. Use active voice if you can.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 187, "column": 190}}}, "severity": "WARNING"}

Check notice on line 187 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L187

[Google.Passive] In general, use active voice instead of passive voice ('be configured').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be configured').", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 187, "column": 190}}}, "severity": "INFO"}

Check notice on line 187 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L187

[write-good.E-Prime] Try to avoid using 'be'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'be'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 187, "column": 190}}}, "severity": "INFO"}
Once the `abort_timeout` is fired, the connection to the deployment endpoint is closed, and all in-flight progress is discarded.

Check notice on line 188 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L188

[write-good.E-Prime] Try to avoid using 'is'.
Raw output
{"message": "[write-good.E-Prime] Try to avoid using 'is'.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 188, "column": 26}}}, "severity": "INFO"}

Check notice on line 188 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L188

[Google.Passive] In general, use active voice instead of passive voice ('is fired').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is fired').", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 188, "column": 26}}}, "severity": "INFO"}

Check warning on line 188 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L188

[write-good.Passive] 'is fired' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'is fired' may be passive voice. Use active voice if you can.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 188, "column": 26}}}, "severity": "WARNING"}

Check notice on line 188 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L188

[Google.Passive] In general, use active voice instead of passive voice ('is closed').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is closed').", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 188, "column": 78}}}, "severity": "INFO"}

Check warning on line 188 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L188

[write-good.Passive] 'is closed' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'is closed' may be passive voice. Use active voice if you can.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 188, "column": 78}}}, "severity": "WARNING"}

Check notice on line 188 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L188

[Google.Passive] In general, use active voice instead of passive voice ('is discarded').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is discarded').", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 188, "column": 116}}}, "severity": "INFO"}

Check warning on line 188 in docs/services/invocation.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/services/invocation.md#L188

[write-good.Passive] 'is discarded' may be passive voice. Use active voice if you can.
Raw output
{"message": "[write-good.Passive] 'is discarded' may be passive voice. Use active voice if you can.", "location": {"path": "docs/services/invocation.md", "range": {"start": {"line": 188, "column": 116}}}, "severity": "WARNING"}

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this not only applies to side effects but computation in general.

Copy link
Contributor Author

@slinkydeveloper slinkydeveloper Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but I think this is easier to explain and probably much more common to happen, I don't really know how to word "computation in general" :) Any proposal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe side effect is fine because it is something people familiar with Restate will understand as a computation step. Computation in general might be misunderstood as the whole handler must not take longer than this duration.