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
Future not completed and onFailure not called when OOM or InterruptedException is thrown #9554
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9554?orig=1
|
This bug does not occur if a |
Looking into this, I've discovered that |
@NthPortal Behavior in the face of fatal exception is undefined. Which version are you referring to specifically? And what code are you saying should be handled differently? |
@viktorklang This issue says the problem says that Currently, the documentation for I'm referring to 2.13, though the problem exists for 2.12 as well. I was referring to |
@NthPortal Where does the docs for the onFailure method say that fatals will get wrapped? (I read it a couple of times now but must have missed it or interpreted it differently) |
@viktorklang It doesn't explicitly say all fatals get wrapped, but it mentions Edit: it also mentions |
@NthPortal Yeah, the docs clearly needs to be more explicit about this. I'll have a look at that as a part of my Futures overhaul. |
@viktorklang Another thing I noticed is that Personally, I think |
@NthPortal The first case (REE thrown) is fixed in the overhaul. The second case (auto-wrapping fatals) won't happen. If you want to have fatals propagate, you are free to add such wrapping explicitly (add the fatal as cause to a RuntimeException and throw that) |
@viktorklang Okay, that seems pretty reasonable. I assume they will still get reported though |
@NthPortal I just implemented and verified support for both interruptions and rejections here: viktorklang/scala-futures@2293c15#diff-823e12da79dd0256861a4903168fab59R344 I hope all mods will be ready in time for 2.13 but cannot guarantee it. |
@viktorklang Cheers! |
With the Future code in 2.13.0-M5 InterruptedExceptions should now be correctly handled. I'd more than welcome some feedback on the new Future handling here. |
When OutOfMemoryError thrown from BroadcastExchangeExec, scala.concurrent.Future will hit scala bug – scala/bug#9554, and hang until future timeout: We could wrap the OOM inside SparkException to resolve this issue. Manually tested. Author: jinxing <jinxing6042@126.com> Closes apache#21342 from jinxing64/SPARK-24294. (cherry-picked from commit b7a036b) Ref: LIHADOOP-40177 RB=1414263 BUG=LIHADOOP-40177 R=fli,mshen,yezhou A=yezhou
scala.concurrent.Future is not completed and onFailure is not called on every case when attached example code is executed. When normal exceptions and "new Error()" is thrown it works as documented, but runs to timeout when OOM / IntEx is thrown. Document clearly states that on IntEx ExectutionException should be the result (and OOM is subclass of Error)
scala.concurrent.Future onFailure document says:
The future may contain a throwable object and this means that the future failed. Futures obtained through combinators have the same exception as the future they were obtained from. The following throwable objects are not contained in the future:
Instead, the future is completed with a ExecutionException with one of the exceptions above as the cause. If a future is failed with a scala.runtime.NonLocalReturnControl, it is completed with a value from that throwable instead.
The text was updated successfully, but these errors were encountered: