Repository navigation
Conversation
Recover in the future worker and rethrow the original panic value when the caller reads the completed future. Add subprocess coverage for catchable exceptions and preserve timeout behavior.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #40.
Currently a panic while evaluating a
futureescapes its worker goroutine and terminates the process, even if the caller wraps@futurein a matchingtry/catch. For example:This patch saves the original panic value in the future and rethrows it when the completed future is dereferenced. The caller can then catch it just as it can catch a synchronous failure. A timed dereference still returns its timeout value if the deadline wins. With no matching handler on dereference, the CLI still exits nonzero through its normal error handling.
The deliberate behavior change is that a failed future that is never dereferenced no longer terminates the process on its own.
Validation on Linux: the full
pkg/langandpkg/runtimetests passed; focused future regressions also passed withglj_aot_runtime. The CLI caught case now continues, and the uncaught case exits 1 and reports the error at dereference.