Stuck in an infinite loop inside Netty when shutting down NIO client

Marc-André Laverdière marcandre.laverdiere at gmail.com
Thu Jun 2 08:34:34 EDT 2011


I am not sure I agree with the solution, but I appreciate the short article
on threads.

Personally, I had to deal with this non-termination issue, I just ensured to
terminate all this stuff ;-)  What I think Netty should give.us is a really
simple way to do a global release of resources.
On 18-May-2011 10:49 PM, "dcerisano" <dcerisano at yahoo.com> wrote:
> Daemons & Zombies 101
>
> By shutting down, I assume you mean exiting the JVM (via jmx, eg.)
> Two things to know about shutting down a JVM:
>
> 1) The JVM will kill all daemonized threads on exit.
> 2) The JVM can hang on any non-daemonized threads on exit.
> 3) A hung JVM is a zombie with a death-grip on ports, preventing restart.
>
> So, you should daemonize all your netty threads, and any other threads you
> create.
> There are several ways to do this, and the API is daemon-aware where it
> needs to be.
>
> I believe that netty should create only daemon threads by default, but the
> opposite is currently the case. I have successfully daemonized all threads
> (netty, timers, etc) in my JVM and it now exits cleanly every time.
>
> This is very important for those building fault-tolerant high availability
> systems which must include fail-over mechanisms like auto-restarting
> (bouncing) a JVM.
>
> Hope this helps - it was a real nasty one to figure out. The good news is:
> Hung JVM? Daemonize your threads.
>
>
>
> -----
> Dominic Cerisano Senior Systems Consultant Email: dcerisano at yahoo.com
http://ca.linkedin.com/in/dcerisano Standard3D See who we know in common
Want a signature like this?
> --
> View this message in context:
http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Stuck-in-an-infinite-loop-inside-Netty-when-shutting-down-NIO-client-tp5761639p6378658.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110602/56dbd253/attachment.html 


More information about the netty-users mailing list