Netty usage in AS5 (shutdown hangs)

이희승 (Trustin Lee) trustin at gmail.com
Tue Sep 1 19:57:08 EDT 2009


Hi Bob,

To shut down a server, you need to:

1) close the server channel
2) close all open other channels
3) destroy ChannelFactory by calling releaseExternalResources()

This procedure can be implemented by following the user guide:

  http://tinyurl.com/ld6j3t

If a ChannelFactory is shared or there are any open connections left,
you must not call releaseExternalResources() as it will result in
resource leak, infinite loop, and so on.

You also might want to take a look at the HornetQ code:

  http://tinyurl.com/nfbj2l

and yeah, I do need to write an example that does shut down correctly -
will do this week.

HTH,
Trustin

On Wed, 2 Sep 2009 06:58:45 +0900 (KST)
Bob McWhirter <bmcwhirt at redhat.com> wrote:
> Howdy Dai and all--
> 
> I'm attempting to use Netty from JBoss AS5, and I'm using Netty's
> own jboss-beans.xml from netty.jar, primarily for the  
> ServerSocketChannelFactory MCBean.
> 
> I ultimately jam that into my own POJO (which may be one of many)  
> which sets up the bootstrap/pipeline, and uses the channel-factory.
> 
> In my own POJO server's stop(), I have
> 
>      ChannelFuture closeFuture = this.channel.close();
>      closeFuture.await( 5, TimeUnit.SECONDS );
>      this.channelFactory.releaseExternalResources();
> 
> It seems that with this block (or even without), shutdown of the AS  
> hangs indefinitely.  Is there more shutdown/cleanup required in
> order to get all lingering threads terminated?
> 
> Also, is the ChannelFactory.releaseExternalResources() safe to call
> if other POJOs are still using the same shared channel factory?
> Will that abruptly destroy things?
> 
> Has anyone else implemented a Netty server as a POJO in
> Microcontainer?
> 
> Thanks,
> 
> 	-Bob
> 
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users



-- 
Trustin Lee, http://gleamynode.net/


More information about the netty-users mailing list