Hi folex, thanks for reporting. Around that time this commit was merged into FSM https://github.com/akka/akka/commit/2c88bb116903b42decb9d8063dc410325a9b9d29 which indeed changes semantics of `stay()` slightly (see documentation). It changed when state transitions are triggered (the events).
I think there's a different inconsistency uncovered by your example though... When using `goto(currentState) forMax Duration.Inf` it was ignored (it seems, didn't debug yet, just observed), the same happens with `stay() forMax Duration.Inf`. However `stay() forMax 10.minutes` did override the 5seconds timeout... I think this is a bug and we should investigate in depth - would you mind opening an issue on http://github.com/akka/akka/issues? If you'd like to a PR fixing it would be even more awesome! :-) Thanks a lot in advance! -- Konrad On Fri, Apr 3, 2015 at 10:38 AM, folex <0xd...@gmail.com> wrote: > sealed trait State > import scala.concurrent.duration._ > import akka.actor._ > > sealed trait Data > case object Initial extends State > case object Waiting extends State > case object Empty extends Data > > class FSMActor extends LoggingFSM[State, Data] { > startWith(Initial, Empty) > > when(Initial) { > case Event("Wait", _) => goto(Waiting) > } > > when(Waiting, stateTimeout = 5.seconds) { > case Event("Message", _) => println(self.path.name + " got > message") > stay() forMax (Duration.Inf) > > case Event(StateTimeout, _) => println(self.path.name + " got > StateTimeout :("); stay() > } > } > > val system = ActorSystem("system") > val fsm = system.actorOf(Props(new FSMActor), "fsm") > fsm ! "Wait" > fsm ! "Message" > > > (code on lpaste: http://lpaste.net/130078) > > But actor keeps receiving StateTimeout messages > > I'm using 2.4-SNAPSHOT, and before Apr 02 update, StateTimeout wasn't > fired even without `forMax` in stay() clause. > > Maybe the problem lays in my understanding of stateTimeout argument? > Should I use setStateTimeout or something? > > Thanks in advance. > > -- > >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com. > To post to this group, send email to akka-user@googlegroups.com. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Akka Team Typesafe - Reactive apps on the JVM Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.