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
CompositeThrowable output should include cause of exceptions #6681
Labels
Milestone
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6681?orig=1 |
Mike Mintz (mikemintz) said: $ scala -Yrepl-class-based
cat: /usr/lib/jvm/java-8-openjdk/release: No such file or directory
Welcome to Scala 2.12.1-20161205-201300-2787b47 (OpenJDK 64-Bit Server VM, Java 1.8.0_112).
Type in expressions for evaluation. Or try :help.
scala> Seq(1,2).par.foreach(i => throw new RuntimeException("Hello", new RuntimeException("World", new RuntimeException("X"))))
java.lang.RuntimeException: Hello
at $anonfun$res0$1(<console>:12)
at $anonfun$res0$1$adapted(<console>:12)
at scala.collection.Iterator.foreach(Iterator.scala:929)
at scala.collection.Iterator.foreach$(Iterator.scala:929)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1406)
at scala.collection.parallel.ParIterableLike$Foreach.leaf(ParIterableLike.scala:970)
at scala.collection.parallel.Task.$anonfun$tryLeaf$1(Tasks.scala:49)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.util.control.Breaks$$anon$1.catchBreak(Breaks.scala:63)
at scala.collection.parallel.Task.tryLeaf(Tasks.scala:52)
at scala.collection.parallel.Task.tryLeaf$(Tasks.scala:46)
at scala.collection.parallel.ParIterableLike$Foreach.tryLeaf(ParIterableLike.scala:967)
at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.internal(Tasks.scala:156)
at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.internal$(Tasks.scala:153)
at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.internal(Tasks.scala:440)
at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.compute(Tasks.scala:146)
at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.compute$(Tasks.scala:145)
at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.compute(Tasks.scala:440)
at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.RuntimeException: World
... 23 more
Caused by: java.lang.RuntimeException: X
... 23 more
Suppressed: java.lang.RuntimeException: Hello
at $anonfun$res0$1(<console>:12)
at $anonfun$res0$1$adapted(<console>:12)
at scala.collection.Iterator.foreach(Iterator.scala:929)
at scala.collection.Iterator.foreach$(Iterator.scala:929)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1406)
at scala.collection.parallel.ParIterableLike$Foreach.leaf(ParIterableLike.scala:970)
at scala.collection.parallel.Task.$anonfun$tryLeaf$1(Tasks.scala:49)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.util.control.Breaks$$anon$1.catchBreak(Breaks.scala:63)
at scala.collection.parallel.Task.tryLeaf(Tasks.scala:52)
at scala.collection.parallel.Task.tryLeaf$(Tasks.scala:46)
at scala.collection.parallel.ParIterableLike$Foreach.tryLeaf(ParIterableLike.scala:967)
at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask.compute(Tasks.scala:149)
... 7 more
Caused by: java.lang.RuntimeException: World
... 20 more
Caused by: java.lang.RuntimeException: X
... 20 more |
@som-snytt said:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When an exception with a cause is thrown, Scala/Java will display the chain of causes.
But when it is thrown inside a parallel collection, the output in "Multiple exceptions thrown during a parallel computation" does not include any of the causes.
Example in Scala 2.10.0-RC2 below.
Regular:
Parallel
The text was updated successfully, but these errors were encountered: