Skip to content

feat: Timeout to detect runaway async consumer effects#1150

Draft
johanandren wants to merge 2 commits intomainfrom
wip-long-async-action-timeout
Draft

feat: Timeout to detect runaway async consumer effects#1150
johanandren wants to merge 2 commits intomainfrom
wip-long-async-action-timeout

Conversation

@johanandren
Copy link
Copy Markdown
Contributor

Not as likely to be used here as in Kalix, but still good as a safeguard to detect a returned async consumer effect where the CompletionStage never completes. If the timeout is hit an error is logged and the event will be retried rather than holding up the consumer stream indefinitely.

@johanandren johanandren marked this pull request as draft November 14, 2025 16:34
@johanandren
Copy link
Copy Markdown
Contributor Author

Should create fewer timers like in lightbend/kalix-jvm-sdk#2383

.flatMap { effect =>
timeoutCancellable.cancel()
toSpiEffect(message, effect)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or shall we have it in the runtime instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rationale for doing it here is that we can do it only for async requests (expecting that such accidents do not happen for normal/blocking vt logic). In runtime we don't know if it was async or not. But maybe we actually want it for both cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants