akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.7k stars 1.04k forks source link

Issues shutting down actor system #3278

Closed yeowgit closed 6 years ago

yeowgit commented 6 years ago

Hi,

I am having problem shutting down my actor system with remote dispatcher thread lingering. I call system.Terminate().Wait() when stopping my service.

This is on Akka v1.3.2

Debug logs as below when shutting down: [DEBUG NLogLogger] received AutoReceiveMessage : [akka://Executioner/user] - ExistenceConfirmed=True [INFO NLogLogger] Shutting down remote daemon. [INFO NLogLogger] Remote daemon shut down; proceeding with flushing remote transports. [DEBUG NLogLogger] now watched by [akka://Executioner/temp/u] [DEBUG NLogLogger] received AutoReceiveMessage [DEBUG NLogLogger] Stopped [INFO NLogLogger] Remoting shut down [INFO NLogLogger] Remoting shut down. [DEBUG NLogLogger] subscribing [akka://all-systems/] to channel Akka.Event.Warning [DEBUG][19/01/2018 18:10:48][Thread 0008][EventStream] subscribing [akka://all-systems/] to channel Akka.Event.Error [DEBUG][19/01/2018 18:10:48][Thread 0008][EventStream] Shutting down: StandardOutLogger started [DEBUG][19/01/2018 18:10:48][Thread 0008][EventStream] unsubscribing [akka://Executioner/system/log1-NLogLogger#1417434207] from all channels

 <hocon>
      <![CDATA[
          akka {
            suppress-json-serializer-warning = on // this flag is obsolete from v1.5.0
            loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]          
            loglevel = DEBUG

            actor {
              provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
              debug
              {
                receive = on      # log any received message
                autoreceive = on  # log automatically received messages, e.g. PoisonPill
                lifecycle = on    # log actor lifecycle changes
                event-stream = on # log subscription changes for Akka.NET event stream
                unhandled = on    # log unhandled messages sent to actors
              }
            }
          }

          akka.extensions = ["Akka.Cluster.Tools.PublishSubscribe.DistributedPubSubExtensionProvider,Akka.Cluster.Tools"]          
      ]]>
  </hocon>

image

Danthar commented 6 years ago

I distinctly remember we had this issue with Helios a long while back. But A: we fixed that, and B: We moved to DotNetty as our default network transport.

I think this issue was fixed even before 1.3.2. But can you update to 1.3.3 and make sure you use the DotNetty transport?

yeowgit commented 6 years ago

That seems to fix it.