Skip to content

[GH-#] Error handling in RunWithTimeout#668

Merged
Un1oR merged 2 commits intomainfrom
feature/GH-#-error-handling-in-run-with-timeout
Mar 27, 2025
Merged

[GH-#] Error handling in RunWithTimeout#668
Un1oR merged 2 commits intomainfrom
feature/GH-#-error-handling-in-run-with-timeout

Conversation

@Un1oR
Copy link
Copy Markdown
Contributor

@Un1oR Un1oR commented Mar 26, 2025

In this PR, two changes related to concurrent.RunWithTimeout:

  1. Instead of panicking, we cancel the current context that the other functions are running with and return the original error from the entire function. This is needed to be able to occasionally terminate with an error, right now we only know how to crash.
  2. We keep track of where the function that ended with the error was created. This is very useful for debugging, because unlike panic (inside a function) when an error occurs, we have no way to reliably trace the source of the problem. I think that overhead is not terrible here, because we only create long-lived functions once at the start of services, and do not do it all the time.

@Un1oR Un1oR force-pushed the feature/GH-#-error-handling-in-run-with-timeout branch from acc8bf8 to a323606 Compare March 27, 2025 09:24
@Un1oR Un1oR force-pushed the feature/GH-#-error-handling-in-run-with-timeout branch from aec3c3f to af26beb Compare March 27, 2025 10:44
@Un1oR Un1oR enabled auto-merge March 27, 2025 10:45
@Un1oR Un1oR added this pull request to the merge queue Mar 27, 2025
Merged via the queue into main with commit 2c9d176 Mar 27, 2025
15 checks passed
@Un1oR Un1oR deleted the feature/GH-#-error-handling-in-run-with-timeout branch March 27, 2025 11:04
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

Successfully merging this pull request may close these issues.

2 participants