From 93786a31fa779ed4f85ec1d553bf4f60f2fd8a72 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 5 Sep 2011 17:29:30 +0200 Subject: [PATCH] Removing preStart invocation for each restart --- .../src/test/scala/akka/actor/ActorRestartSpec.scala | 4 ---- akka-actor/src/main/scala/akka/actor/ActorRef.scala | 1 - 2 files changed, 5 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorRestartSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorRestartSpec.scala index 040e06e62a..b1cfeba83f 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorRestartSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorRestartSpec.scala @@ -100,7 +100,6 @@ class ActorRestartSpec extends WordSpec with MustMatchers with TestKit with Befo actor ! Kill within(1 second) { expectMsg(("preRestart", Some(Kill), 1)) - expectMsg(("preStart", 2)) expectMsg(("postRestart", 2)) expectNoMsg } @@ -121,7 +120,6 @@ class ActorRestartSpec extends WordSpec with MustMatchers with TestKit with Befo tRef.underlyingActor must be(tActor) expectMsg((tActor, tRef)) tRef.stop() - expectMsg(("preStart", 2)) expectMsg(("postRestart", 2)) expectNoMsg } @@ -139,7 +137,6 @@ class ActorRestartSpec extends WordSpec with MustMatchers with TestKit with Befo actor ! Kill within(1 second) { expectMsg(("preRestart", Some(Kill), 1)) - expectMsg(("preStart", 2)) expectMsg(("postRestart", 2)) expectNoMsg } @@ -159,7 +156,6 @@ class ActorRestartSpec extends WordSpec with MustMatchers with TestKit with Befo actor ! Kill within(1 second) { expectMsg(("preRestart", Some(Kill), 1)) - expectMsg(("preStart", 2)) expectMsg(("postRestart", 2)) expectNoMsg } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index 557985ddde..1a1f439ad5 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -848,7 +848,6 @@ class LocalActorRef private[akka] (private[this] val props: Props, val address: val freshActor = newActor setActorSelfFields(failedActor, null) // Only null out the references if we could instantiate the new actor actorInstance.set(freshActor) // Assign it here so if preStart fails, we can null out the sef-refs next call - freshActor.preStart() freshActor.postRestart(reason) if (Actor.debugLifecycle) EventHandler.debug(freshActor, "restarted") }