Remove the default reschedule=true arg to internal checkReceiveTimeout (#28399)

This commit is contained in:
Helena Edelson 2019-12-19 07:00:51 -08:00 committed by GitHub
parent 2c15c8d753
commit 7f733b4504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View file

@ -0,0 +1,5 @@
# Remove the default reschedule=true arg to internal checkReceiveTimeout #28399
# class akka.actor.ActorCell does not have a correspondent in current version
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.actor.ActorCell.checkReceiveTimeout$default$1")
# interface akka.actor.dungeon.ReceiveTimeout does not have a correspondent in current version
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.actor.dungeon.ReceiveTimeout.checkReceiveTimeout$default$1")

View file

@ -635,7 +635,7 @@ private[akka] class ActorCell(
val created = newActor() val created = newActor()
actor = created actor = created
created.aroundPreStart() created.aroundPreStart()
checkReceiveTimeout() checkReceiveTimeout(reschedule = true)
if (system.settings.DebugLifecycle) if (system.settings.DebugLifecycle)
publish(Debug(self.path.toString, clazz(created), "started (" + created + ")")) publish(Debug(self.path.toString, clazz(created), "started (" + created + ")"))
} catch { } catch {

View file

@ -244,7 +244,7 @@ private[akka] trait FaultHandling { this: ActorCell =>
if (freshActor eq failedActor) setActorFields(freshActor, this, self) // If the creator returns the same instance, we need to restore our nulled out fields. if (freshActor eq failedActor) setActorFields(freshActor, this, self) // If the creator returns the same instance, we need to restore our nulled out fields.
freshActor.aroundPostRestart(cause) freshActor.aroundPostRestart(cause)
checkReceiveTimeout() // user may have set a receive timeout in preStart which is called from postRestart checkReceiveTimeout(reschedule = true) // user may have set a receive timeout in preStart which is called from postRestart
if (system.settings.DebugLifecycle) publish(Debug(self.path.toString, clazz(freshActor), "restarted")) if (system.settings.DebugLifecycle) publish(Debug(self.path.toString, clazz(freshActor), "restarted"))
// only after parent is up and running again do restart the children which were not stopped // only after parent is up and running again do restart the children which were not stopped

View file

@ -31,11 +31,11 @@ private[akka] trait ReceiveTimeout { this: ActorCell =>
if (hasTimeoutData || receiveTimeoutChanged(beforeReceive)) if (hasTimeoutData || receiveTimeoutChanged(beforeReceive))
checkReceiveTimeout(!message.isInstanceOf[NotInfluenceReceiveTimeout] || receiveTimeoutChanged(beforeReceive)) checkReceiveTimeout(!message.isInstanceOf[NotInfluenceReceiveTimeout] || receiveTimeoutChanged(beforeReceive))
final def checkReceiveTimeout(reschedule: Boolean = true): Unit = { final def checkReceiveTimeout(reschedule: Boolean): Unit = {
val (recvTimeout, task) = receiveTimeoutData val (recvTimeout, task) = receiveTimeoutData
recvTimeout match { recvTimeout match {
case f: FiniteDuration => case f: FiniteDuration =>
// The fact that timeout is FiniteDuration and task is emptyCancellable // The fact that recvTimeout is FiniteDuration and task is emptyCancellable
// means that a user called `context.setReceiveTimeout(...)` // means that a user called `context.setReceiveTimeout(...)`
// while sending the ReceiveTimeout message is not scheduled yet. // while sending the ReceiveTimeout message is not scheduled yet.
// We have to handle the case and schedule sending the ReceiveTimeout message // We have to handle the case and schedule sending the ReceiveTimeout message