Skip to content

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

Merged
merged 2 commits into from
Jul 15, 2015
Merged

Updating the description of Future exception re-throwing #434

merged 2 commits into from
Jul 15, 2015

Conversation

demobox
Copy link
Contributor

@demobox demobox commented Jul 13, 2015

@SethTisue
Copy link
Member

I believe you want to be updating http://docs.scala-lang.org/overviews/core/futures.html, not the SIP page?

@demobox
Copy link
Contributor Author

demobox commented Jul 14, 2015

Hi @SethTisue

I believe you want to be updating http://docs.scala-lang.org/overviews/core/futures.html

Yes, er, that was indeed the plan ;-) Of the five pages I could find that obviously reference futures:

image

I thought this one (overviews/core/_posts/2012-09-20-futures.md) was the most likely. If it's not the right one, please let me know which doc I should be updating instead.

Thanks!

@SethTisue
Copy link
Member

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

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).

Copy link
Contributor Author

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."

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).

Copy link
Contributor Author

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."

?

Choose a reason for hiding this comment

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

SGTM

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.
Copy link
Contributor Author

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!

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 :)

Copy link
Contributor Author

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..? ;-)

Copy link
Member

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.

SethTisue added a commit that referenced this pull request Jul 15, 2015
Updating the description of Future exception re-throwing
@SethTisue SethTisue merged commit 3870bc3 into scala:master Jul 15, 2015
@SethTisue
Copy link
Member

thank you, @demobox! much appreciated.

@demobox
Copy link
Contributor Author

demobox commented Jul 16, 2015

SethTisue merged commit 3870bc3

Thanks, @SethTisue!

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.

3 participants