Shutting down a netty client when an exception occurs

tsuna tsunanet at gmail.com
Thu Nov 11 12:58:07 EST 2010


On Thu, Nov 11, 2010 at 2:08 AM, gurrie <gurrie at gmail.com> wrote:
>
> Hi,
>
> Looking at the netty documentation, the correct way to cleanly shutdown a
> client is to :
>
> 1. Close the channel
> 2. Release the external resources
>
> What are the correct steps to follow in the event of an exception occurring?
> If we follow the steps mentioned above, we seem to end up in an infinite
> loop as the releaseExternalResources call is trying to shutdown the thread
> that is actually calling releaseExternalResources,

http://netty-forums-and-mailing-lists.685743.n2.nabble.com/SocketChannelFactory-releaseExternalResources-causes-an-infinite-loop-if-called-from-a-Netty-IO-thred-td5492010.html

Unfortunately, Netty requires you to call releaseExternalResources
from outside an NIO thread.  I think the best thing to do is to create
a new thread just for this purpose.

-- 
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com


More information about the netty-users mailing list