If an actor is blocking (processing a message) the shutdown will not complete until that is finished. /Patrik
On Fri, Feb 20, 2015 at 10:30 AM, Akka Team <[email protected]> wrote: > Hi there and welcome to akka-user! > In general it shouldn't take that long for an actor system to shut down, > would you mind sharing an outline of the code you're using to shutdown the > system? > Are you sure shutdown was actually called? Shutting down is progagated as > system message, which has higher priority than user-land messages, so it > shouldn't get held up by high user-land traffic.. > Also, here's a nice slightly more useful way to get stacktraces of a > running app: > > jps # find the java process id > jstack JPID > > which will give you a full stacktrace of all threads, that's usually the > preferred way to share stacktraces. > > -- Konrad > > On Mon, Feb 16, 2015 at 8:02 AM, George Lu <[email protected]> wrote: > >> Dear all, >> >> I searched on Google but cannot find any similar topics. I am a Akka >> newbie and used Akka to start some workers to process time consuming tasks. >> I used system.AwaitTermination() and system.shutdown() to shutdown Akka. >> My Akka used RoundRobinRouter and schedules 10 workers. >> But, the JVM does not exit. Then I print all running threads. >> >> Map<Thread, StackTraceElement[]> threads = Thread.getAllStackTraces(); >> for(Thread t:threads.keySet()){ >> >> System.out.println("--------------------------------------------------------"); >> System.out.println(t.getId()+":"+t.getName()+" is >> daemon:"+t.isDaemon()); >> for(StackTraceElement stackTrace: threads.get(t)){ >> >> System.out.println(stackTrace.getFileName()); >> System.out.println(stackTrace.getClassName()); >> System.out.println(stackTrace.getMethodName()); >> System.out.println(stackTrace.isNativeMethod()); >> } >> >> System.out.println("--------------------------------------------------------"); >> } >> >> The following is the output. >> Can anyone give me any hint whether is Akka prevent the JVM from exiting >> and if it is, how to prevent that? >> >> Thanks! >> George >> >> -------------------------------------------------------- >> 2:Reference Handler is daemon:true >> Object.java >> java.lang.Object >> wait >> true >> Object.java >> java.lang.Object >> wait >> false >> Reference.java >> java.lang.ref.Reference$ReferenceHandler >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 27:CreationSystem-akka.actor.default-dispatcher-6 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> idleAwaitWork >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> scan >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> runWorker >> false >> ForkJoinWorkerThread.java >> scala.concurrent.forkjoin.ForkJoinWorkerThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 20:pool-3-thread-1 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> LockSupport.java >> java.util.concurrent.locks.LockSupport >> park >> false >> AbstractQueuedSynchronizer.java >> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject >> await >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> getTask >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> runWorker >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor$Worker >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 18:CreationSystem-akka.actor.default-dispatcher-4 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> scan >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> runWorker >> false >> ForkJoinWorkerThread.java >> scala.concurrent.forkjoin.ForkJoinWorkerThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 12:C3P0PooledConnectionPoolManager[identityToken->1hge24797149gw291ezhx58|6badc6a5]-HelperThread-#0 >> is daemon:true >> Object.java >> java.lang.Object >> wait >> true >> ThreadPoolAsynchronousRunner.java >> com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 22:pool-3-thread-3 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> LockSupport.java >> java.util.concurrent.locks.LockSupport >> park >> false >> AbstractQueuedSynchronizer.java >> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject >> await >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> getTask >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> runWorker >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor$Worker >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 28:Keep-Alive-Timer is daemon:true >> Thread.java >> java.lang.Thread >> sleep >> true >> KeepAliveCache.java >> sun.net.www.http.KeepAliveCache >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 4:Signal Dispatcher is daemon:true >> -------------------------------------------------------- >> -------------------------------------------------------- >> 29:CreationSystem-akka.actor.default-dispatcher-7 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> scan >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> runWorker >> false >> ForkJoinWorkerThread.java >> scala.concurrent.forkjoin.ForkJoinWorkerThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 1:main is daemon:false >> Thread.java >> java.lang.Thread >> dumpThreads >> true >> Thread.java >> java.lang.Thread >> getAllStackTraces >> false >> TestAkka.java >> com.toucha.platform.common.akka.TestAkka >> main >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 19:pool-2-thread-1 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> LockSupport.java >> java.util.concurrent.locks.LockSupport >> parkNanos >> false >> AbstractQueuedSynchronizer.java >> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject >> awaitNanos >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> getTask >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> runWorker >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor$Worker >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 24:pool-3-thread-5 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> LockSupport.java >> java.util.concurrent.locks.LockSupport >> park >> false >> AbstractQueuedSynchronizer.java >> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject >> await >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> getTask >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> runWorker >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor$Worker >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 16:CreationSystem-akka.actor.default-dispatcher-2 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> scan >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> runWorker >> false >> ForkJoinWorkerThread.java >> scala.concurrent.forkjoin.ForkJoinWorkerThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 21:pool-3-thread-2 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> LockSupport.java >> java.util.concurrent.locks.LockSupport >> park >> false >> AbstractQueuedSynchronizer.java >> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject >> await >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> getTask >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> runWorker >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor$Worker >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 11:C3P0PooledConnectionPoolManager[identityToken->1hge24797149gw291ezhx58|6badc6a5]-AdminTaskTimer >> is daemon:true >> Object.java >> java.lang.Object >> wait >> true >> Timer.java >> java.util.TimerThread >> mainLoop >> false >> Timer.java >> java.util.TimerThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 3:Finalizer is daemon:true >> Object.java >> java.lang.Object >> wait >> true >> ReferenceQueue.java >> java.lang.ref.ReferenceQueue >> remove >> false >> ReferenceQueue.java >> java.lang.ref.ReferenceQueue >> remove >> false >> Finalizer.java >> java.lang.ref.Finalizer$FinalizerThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 14:C3P0PooledConnectionPoolManager[identityToken->1hge24797149gw291ezhx58|6badc6a5]-HelperThread-#2 >> is daemon:true >> Object.java >> java.lang.Object >> wait >> true >> ThreadPoolAsynchronousRunner.java >> com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 23:pool-3-thread-4 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> LockSupport.java >> java.util.concurrent.locks.LockSupport >> parkNanos >> false >> AbstractQueuedSynchronizer.java >> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject >> awaitNanos >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> getTask >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> runWorker >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor$Worker >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 13:C3P0PooledConnectionPoolManager[identityToken->1hge24797149gw291ezhx58|6badc6a5]-HelperThread-#1 >> is daemon:true >> Object.java >> java.lang.Object >> wait >> true >> ThreadPoolAsynchronousRunner.java >> com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 25:pool-3-thread-6 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> LockSupport.java >> java.util.concurrent.locks.LockSupport >> parkNanos >> false >> AbstractQueuedSynchronizer.java >> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject >> awaitNanos >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ScheduledThreadPoolExecutor.java >> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue >> take >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> getTask >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor >> runWorker >> false >> ThreadPoolExecutor.java >> java.util.concurrent.ThreadPoolExecutor$Worker >> run >> false >> Thread.java >> java.lang.Thread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 26:CreationSystem-akka.actor.default-dispatcher-5 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> compareAndSwapLong >> true >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> tryTerminate >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> idleAwaitWork >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> scan >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> runWorker >> false >> ForkJoinWorkerThread.java >> scala.concurrent.forkjoin.ForkJoinWorkerThread >> run >> false >> -------------------------------------------------------- >> -------------------------------------------------------- >> 5:Attach Listener is daemon:true >> -------------------------------------------------------- >> -------------------------------------------------------- >> 17:CreationSystem-akka.actor.default-dispatcher-3 is daemon:false >> Unsafe.java >> sun.misc.Unsafe >> park >> true >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> scan >> false >> ForkJoinPool.java >> scala.concurrent.forkjoin.ForkJoinPool >> runWorker >> false >> ForkJoinWorkerThread.java >> scala.concurrent.forkjoin.ForkJoinWorkerThread >> run >> false >> -------------------------------------------------------- >> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Akka Team > Typesafe - The software stack for applications that scale > Blog: letitcrash.com > Twitter: @akkateam > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw [image: Scala Days] <http://event.scaladays.org/scaladays-sanfran-2015> -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
