-
Notifications
You must be signed in to change notification settings - Fork 1k
Updating the description of Future exception re-throwing #434
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
Conversation
I believe you want to be updating http://docs.scala-lang.org/overviews/core/futures.html, not the SIP page? |
Hi @SethTisue
Yes, er, that was indeed the plan ;-) Of the five pages I could find that obviously reference futures: I thought this one ( Thanks! |
You're totally right. I was confused. |
exceptions normally not handled by the client code and at the same time inform | ||
the client in which future the computation failed. | ||
|
||
Fatal exceptions (as determined by `NonFatal`) are rethrown in the thread executing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I think it would be great to also explain the rationality for rethrowing Fatals (fail fast).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rationality for rethrowing Fatals (fail fast).
@viktorklang Could you explain that in a bit more detail? Unless I'm misunderstanding something, it's not the caller that fails fast, it's the worker thread that was actually executing the body of the Future.
Do you mean that the idea is to ensure that worker processes that are "irretrievably broken" die off as soon as a non-recoverable error is detected? In that case, how about the following?
"Fatal exceptions (as determined by NonFatal
) are rethrown in the thread executing the failed asynchronous computation.This ensures that "broken" threads in the ExecutionContext
fail fast, and can be replaced if necessary. See NonFatal
for a more precise description of the semantics."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's rethrown to the worker to escalate the problem upwards (instead of pushing the problem downstream to the consumer, which may or may not be listening or dealing with those kinds of problems).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@viktorklang Thanks for clarifying. In that case, how about:
"Fatal exceptions (as determined by NonFatal) are rethrown in the thread executing the failed asynchronous computation.This informs the code managing the executing threads of the problem and allows it to fail fast, if necessary. See NonFatal for a more precise description of the semantics."
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
Based on review comments by @viktorklang
the failed asynchronous computation. This informs the code managing the executing | ||
threads of the problem and allows it to fail fast, if necessary. See | ||
[`NonFatal`](http://www.scala-lang.org/api/current/index.html#scala.util.control.NonFatal$) | ||
for a more precise description of the semantics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@viktorklang Updated. Let me know if you'd like me to squash the commits down.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's up to @SethTisue :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's up to Seth Tisue :)
@SethTisue: ping..? ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to my knowledge, we're not picky about that in this repo.
Updating the description of Future exception re-throwing
thank you, @demobox! much appreciated. |
Thanks, @SethTisue! |
See https://groups.google.com/forum/#!topic/scala-language/PeAuAK6_Aj8
/cc @viktorklang