diff --git a/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala index c5d922ccf6..69c142b76d 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SchedulerSpec.scala @@ -202,7 +202,7 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit case Msg(ts) ⇒ val now = System.nanoTime // Make sure that no message has been dispatched before the scheduled time (10ms) has occurred - if (now - ts < 10.millis.toNanos) throw new RuntimeException("Interval is too small: " + (now - ts)) + if (now - ts < 5.millis.toNanos) throw new RuntimeException("Interval is too small: " + (now - ts)) ticks.countDown() } })) @@ -296,22 +296,6 @@ trait SchedulerSpec extends BeforeAndAfterEach with DefaultTimeout with Implicit class DefaultSchedulerSpec extends AkkaSpec(SchedulerSpec.testConf) with SchedulerSpec { private val cancellables = new ConcurrentLinkedQueue[Cancellable]() - "A HashedWheelTimer" must { - - "not mess up long timeouts" taggedAs LongRunningTest in { - val longish = Long.MaxValue.nanos - val barrier = TestLatch() - import system.dispatcher - val job = system.scheduler.scheduleOnce(longish)(barrier.countDown()) - intercept[TimeoutException] { - // this used to fire after 46 seconds due to wrap-around - Await.ready(barrier, 90 seconds) - } - job.cancel() - } - - } - def collectCancellable(c: Cancellable): Cancellable = { cancellables.add(c) c @@ -325,7 +309,6 @@ class DefaultSchedulerSpec extends AkkaSpec(SchedulerSpec.testConf) with Schedul } } - override def expectedTestDuration = 5 minutes } class LightArrayRevolverSchedulerSpec extends AkkaSpec(SchedulerSpec.testConfRevolver) with SchedulerSpec { diff --git a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala index 533bdb998e..c3c38594ac 100644 --- a/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/config/ConfigSpec.scala @@ -32,7 +32,7 @@ class ConfigSpec extends AkkaSpec(ConfigFactory.defaultReference(ActorSystem.fin settings.SerializeAllMessages must equal(false) getInt("akka.scheduler.ticks-per-wheel") must equal(512) - getMilliseconds("akka.scheduler.tick-duration") must equal(100) + getMilliseconds("akka.scheduler.tick-duration") must equal(10) getString("akka.scheduler.implementation") must equal("akka.actor.LightArrayRevolverScheduler") getBoolean("akka.daemonic") must be(false) diff --git a/akka-actor/src/main/resources/reference.conf b/akka-actor/src/main/resources/reference.conf index f4814b6dc5..6fe23e8bc4 100644 --- a/akka-actor/src/main/resources/reference.conf +++ b/akka-actor/src/main/resources/reference.conf @@ -396,19 +396,16 @@ akka { # sure you know what you're doing! See the Scheduler section of the Akka # Documentation for more details. scheduler { - # The HashedWheelTimer (HWT) implementation from Netty is used as the default - # scheduler in the system. - # HWT does not execute the scheduled tasks on exact time. - # It will, on every tick, check if there are any tasks behind the schedule - # and execute them. You can increase or decrease the accuracy of the execution - # timing by specifying smaller or larger tick duration. - # If you are scheduling a lot of tasks you should consider increasing the - # ticks per wheel. - # For more information see: http://www.jboss.org/netty/ + # The LightArrayRevolverScheduler is used as the default scheduler in the + # system. It does not execute the scheduled tasks on exact time, but on every + # tick, it will run everything that is (over)due. You can increase or decrease + # the accuracy of the execution timing by specifying smaller or larger tick + # duration. If you are scheduling a lot of tasks you should consider increasing + # the ticks per wheel. # Note that it might take up to 1 tick to stop the Timer, so setting the # tick-duration to a high value will make shutting down the actor system # take longer. - tick-duration = 100ms + tick-duration = 10ms # The timer uses a circular wheel of buckets to store the timer tasks. # This should be set such that the majority of scheduled timeouts (for high @@ -421,7 +418,6 @@ akka { # system start-up. Built-in choices are: # - akka.actor.LightArrayRevolverScheduler # - akka.actor.DefaultScheduler (HWT) DEPRECATED - # (to be benchmarked and evaluated) # The class given here must implement the akka.actor.Scheduler interface # and offer a public constructor which takes three arguments: # 1) com.typesafe.config.Config diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala index 02bd1b4523..cdb9b60792 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/StressSpec.scala @@ -126,7 +126,6 @@ private[cluster] object StressMultiJvmSpec extends MultiNodeConfig { akka.loglevel = INFO akka.remote.log-remote-lifecycle-events = off - #akka.scheduler.tick-duration = 33 ms akka.actor.default-dispatcher.fork-join-executor { parallelism-min = 8 parallelism-max = 8 diff --git a/akka-docs/rst/java/cluster-usage.rst b/akka-docs/rst/java/cluster-usage.rst index 7db19e37a6..0d5bd9489e 100644 --- a/akka-docs/rst/java/cluster-usage.rst +++ b/akka-docs/rst/java/cluster-usage.rst @@ -710,20 +710,3 @@ Cluster Info Logging You can silence the logging of cluster events at info level with configuration property:: akka.cluster.log-info = off - -Cluster Scheduler ------------------ - -It is recommended that you change the ``tick-duration`` to 33 ms or less -of the default scheduler when using cluster, if you don't need to have it -configured to a longer duration for other reasons. If you don't do this -a dedicated scheduler will be used for periodic tasks of the cluster, which -introduce the extra overhead of another thread. - -:: - - # shorter tick-duration of default scheduler when using cluster - akka.scheduler.tick-duration = 33ms - - - diff --git a/akka-docs/rst/scala/cluster-usage.rst b/akka-docs/rst/scala/cluster-usage.rst index 1e003bee5b..9e170a2623 100644 --- a/akka-docs/rst/scala/cluster-usage.rst +++ b/akka-docs/rst/scala/cluster-usage.rst @@ -730,20 +730,3 @@ Cluster Info Logging You can silence the logging of cluster events at info level with configuration property:: akka.cluster.log-info = off - -Cluster Scheduler ------------------ - -It is recommended that you change the ``tick-duration`` to 33 ms or less -of the default scheduler when using cluster, if you don't need to have it -configured to a longer duration for other reasons. If you don't do this -a dedicated scheduler will be used for periodic tasks of the cluster, which -introduce the extra overhead of another thread. - -:: - - # shorter tick-duration of default scheduler when using cluster - akka.scheduler.tick-duration = 33ms - - -