Created
February 17, 2016 15:58
-
-
Save MartinSeeler/1ab2a8d14bb8de126162 to your computer and use it in GitHub Desktop.
Akka Stream Stackoverflow Exception
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
import akka.actor.ActorSystem | |
import akka.stream.{ActorMaterializer, SourceShape} | |
import akka.stream.scaladsl._ | |
object CrashDemo extends App { | |
implicit val system = ActorSystem("error-reproduction-demo") | |
implicit val mat = ActorMaterializer() | |
import system.dispatcher | |
val numbers = Source(1 to 1000) | |
val numberOfFlows = 5000 | |
Source.fromGraph(GraphDSL.create() { implicit builder: GraphDSL.Builder[Unit] => | |
import GraphDSL.Implicits._ | |
val bcast = builder.add(Broadcast[Int](numberOfFlows)) | |
val merge = builder.add(Merge[Int](numberOfFlows)) | |
numbers ~> bcast | |
for (x ← 1 to numberOfFlows) { | |
bcast.out(x - 1) ~> Flow[Int].map(x ⇒ x * x) ~> merge.in(x - 1) | |
} | |
SourceShape(merge.out) | |
}).runForeach(println).onComplete(_ ⇒ system.terminate()) | |
} |
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
Exception in thread "main" java.lang.StackOverflowError | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
at akka.stream.impl.fusing.Fusing$.rewriteMat(Fusing.scala:415) | |
.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment