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

timeout behaviour when computation fails #211

Closed
nimatrueway opened this issue Sep 10, 2024 · 1 comment
Closed

timeout behaviour when computation fails #211

nimatrueway opened this issue Sep 10, 2024 · 1 comment

Comments

@nimatrueway
Copy link
Contributor

nimatrueway commented Sep 10, 2024

timeout(1.second) {
  throw new Throwable("failed computation")
}

Currently, timeout is implemented using race which results in a behaviour where in the face of computation failure the block still waits until the timeout timer kicks in and the block fails with a timeout exception.

// currently: throws after 1 second
TimeoutException(s"Timed out after 1 second")

I believe though, the typical expectation of timeout is to quickly fail the block with the same exception as the failed computation throws and do not wait for the timeout timer to trigger.

// expected: immediately throw
Throwable("failed computation")

I'm pretty confident that we are aligned on this, so I'll prepare a small PR

@adamw
Copy link
Member

adamw commented Sep 10, 2024

Of course, you are right - thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants