Hi ! Im seeing the following exception
java.lang.IllegalStateException: cannot enqueue after timer shutdown
at akka.actor.LightArrayRevolverScheduler.scheduleOnce(LightArrayRevolverScheduler.scala:136)
at akka.actor.Scheduler.scheduleOnce(Scheduler.scala:205)
at akka.actor.Scheduler.scheduleOnce$(Scheduler.scala:202)
at akka.actor.LightArrayRevolverScheduler.scheduleOnce(LightArrayRevolverScheduler.scala:37)
at akka.pattern.PromiseActorRef$.apply(AskSupport.scala:604)
at akka.pattern.GracefulStopSupport.gracefulStop(GracefulStopSupport.scala:48)
at akka.pattern.GracefulStopSupport.gracefulStop$(GracefulStopSupport.scala:46)
at akka.pattern.package$.gracefulStop(package.scala:42)
at akka.pattern.Patterns$.gracefulStop(Patterns.scala:238)
at akka.pattern.Patterns.gracefulStop(Patterns.scala)
when performing gracefulStop on an actor in cluster mode:
Cluster cluster = Cluster.get(myActorSystem);
cluster.leave(cluster.selfAddress());
Thread.sleep(1000);
Patterns.gracefulStop(actorRef, Duration.create(1, TimeUnit.MINUTES))
Logs say
11:39:30 [INFO ] [a.c.Cluster(akka://my) ] [my-akka.actor.default-dispatcher-3] - Cluster Node [akka.tcp://my@127.0.0.1:2552] - Marked address [akka.tcp://my@127.0.0.1:2552] as [Leaving]
11:39:31 [INFO ] [a.c.Cluster(akka://my) ] [my-akka.actor.default-dispatcher-2] - Cluster Node [akka.tcp://my@127.0.0.1:2552] - Exiting (leader), starting coordinated shutdown
11:39:31 [INFO ] [a.c.Cluster(akka://my) ] [my-akka.actor.default-dispatcher-1] - Cluster Node [akka.tcp://my@127.0.0.1:2552] - Leader is moving node [akka.tcp://my@127.0.0.1:2552] to [Exiting]
11:39:31 [INFO ] [a.c.Cluster(akka://my) ] [my-akka.actor.default-dispatcher-2] - Cluster Node [akka.tcp://my@127.0.0.1:2552] - Exiting completed
11:39:31 [INFO ] [a.c.Cluster(akka://my) ] [my-akka.actor.default-dispatcher-2] - Cluster Node [akka.tcp://my@127.0.0.1:2552] - Shutting down...
11:39:31 [INFO ] [a.c.Cluster(akka://my) ] [my-akka.actor.default-dispatcher-2] - Cluster Node [akka.tcp://my@127.0.0.1:2552] - Successfully shut down
11:39:31 [INFO ] [emoteActorRefProvider$RemotingTerminator] [my-akka.actor.default-dispatcher-3] - Shutting down remote daemon.
11:39:31 [INFO ] [emoteActorRefProvider$RemotingTerminator] [my-akka.actor.default-dispatcher-3] - Remote daemon shut down; proceeding with flushing remote transports.
11:39:31 [INFO ] [a.r.Remoting ] [my-akka.actor.default-dispatcher-3] - Remoting shut down
11:39:31 [INFO ] [emoteActorRefProvider$RemotingTerminator] [my-akka.actor.default-dispatcher-2] - Remoting shut down.
11:39:31 [ERROR] [m.ShutdownOperation ] [qtp46494202-112] - Unable to execute operation class my.ShutdownOperation
java.lang.IllegalStateException: cannot enqueue after timer shutdown
at akka.actor.LightArrayRevolverScheduler.scheduleOnce(LightArrayRevolverScheduler.scala:136)
Is this expected ? Akka 2.5.12. Without the “Thread.sleep(1000);” the gracefulStop seems to do ok (most of the time it seems).