I made it a ticket to make sure we re-visit this: https://github.com/akka/akka/issues/18268
-- konrad W dniu środa, 19 sierpnia 2015 16:35:42 UTC+2 użytkownik Konrad Malawski napisał: > > Hi Alessandro, > I'm not sure to be honest. We have not revisited if this is indeed the > case on 2.11 and 2.12 (which has gotten a new optimiser (fully rewritten)). > One thing that still applies for sure is that if scalac inlines things you > aggresively binary compatibility may not hold as you'd expect it to (i.e. > if you have code with @inline with Akka things), > as it could have inlined something else than currently lies within a > method etc.. > > Having that said, I don't know and we'll need to revisit the comment (best > around the time when Scala 2.12 hits 2.12.0), and amend if not appropriate > anymore. > > On Sat, Aug 15, 2015 at 5:04 AM, Alessandro Vermeulen < > [email protected]> wrote: > >> Hi all, >> >> It has been a few years since this was discovered and the warning is >> still present [1] in the docs. Is this advise still the case, and/or are >> there ways to test with optimisation on that we can use to check for this >> "weird behaviour"? >> >> Cheers, >> Alessandro >> >> On Friday, April 12, 2013 at 12:20:22 PM UTC-7, Jamie Allen wrote: >>> >>> I noticed I wasn't getting output to the console when an actor had an >>> exception, and couldn't figure out why. It turned out I was specifying the >>> "-optimize" scalac flag in my build.sbt. As a simple example of how to >>> reproduce this, here is a simple build.sbt file: >>> >>> >>> scalaVersion := "2.9.1" >>> >>> name := "Akka Logging Test" >>> >>> scalacOptions += "-optimize" >>> >>> libraryDependencies += "com.typesafe.akka" % "akka-actor" % "2.0.3" >>> >>> >>> And here is some simple code to reproduce: >>> >>> import akka.actor.OneForOneStrategy >>> import akka.actor.SupervisorStrategy._ >>> import akka.actor.ActorSystem >>> import akka.actor.Actor >>> import akka.util.duration._ >>> import akka.actor.Props >>> case object Start >>> case object MakeCrash >>> // Create a supervisor and an actor that dies 5 times in 1 minute, check >>> output in logs >>> class MySupervisor extends Actor { >>> override val supervisorStrategy = OneForOneStrategy(maxNrOfRetries = 5, >>> withinTimeRange = 1 minute) { >>> case ae: ArithmeticException => Restart >>> } >>> def child = context.actorOf(Props[MyChild]) >>> def receive = { >>> case Start => child ! MakeCrash >>> } >>> } >>> class MyChild extends Actor { >>> def receive = { >>> case MakeCrash => 1 / 0 >>> } >>> } >>> object TestBootstrap extends App { >>> val system = ActorSystem() >>> val supervisor = system.actorOf(Props[MySupervisor]) >>> supervisor ! Start >>> Thread.sleep(2000) >>> supervisor ! Start >>> Thread.sleep(2000) >>> supervisor ! Start >>> Thread.sleep(2000) >>> supervisor ! Start >>> Thread.sleep(2000) >>> supervisor ! Start >>> Thread.sleep(2000) >>> // Should be dead now >>> supervisor ! Start >>> Thread.sleep(2000) >>> system.shutdown >>> } >>> >>> To fix the problem, just remove the scalacOptions from the build.sbt >>> file. >>> >>> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Cheers, > Konrad 'ktoso' Malawski > Akka <http://akka.io/> @ Typesafe <http://typesafe.com/> > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
