Shutdown of Server Channel Factory
Michael McGrady
mmcgrady at topiatechnology.com
Wed Sep 9 13:39:57 EDT 2009
Thomas:
I added a check on the connection:
public void stop() {
logger.log(InternalLogLevel.INFO, this.getClass().getSimpleName()
+ " start stop");
ChannelFuture close = this.channel.close();
close.addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture future)
throws Exception {
logger.log(InternalLogLevel.INFO, "Connected: " +
future.getChannel().isConnected());
NettyKarmaReceiver.this.factory.releaseExternalResources();
logger.log(InternalLogLevel.INFO, this.getClass().getSimpleName()
+ " end stop");
}
});
}
The result is:
FILE: /Users/mgmcgrady/.KARMA/.AUM/46caf8e6-
aec1-4ead-967e-8fbe4d142327/info.jar exists: true
FILE: /Users/mgmcgrady/.KARMA/.AUM/46caf8e6-
aec1-4ead-967e-8fbe4d142327/info.txt exists: true
FILE: /Users/mgmcgrady/.KARMA/.AUM/46caf8e6-
aec1-4ead-967e-8fbe4d142327/spring.jar exists: true
FILE: /Users/mgmcgrady/.KARMA/.AUM/46caf8e6-
aec1-4ead-967e-8fbe4d142327/spring1.jar exists: true
FILE: /Users/mgmcgrady/.KARMA/.AUM/46caf8e6-
aec1-4ead-967e-8fbe4d142327/spring2.jar exists: true
Time in milliseconds: 1375
Sep 9, 2009 10:33:34 AM
com.topiatechnology.karma.spi.transportadapter.netty.NettyKarmaReceiver
INFO: NettyKarmaReceiver start stop
Sep 9, 2009 10:33:34 AM
com.topiatechnology.karma.spi.transportadapter.netty.NettyKarmaReceiver
INFO: Connected: false
start release resources
The last line comes from:
public void releaseExternalResources() {
System.out.println("start release resources");
ExecutorUtil.terminate(bossExecutor, workerExecutor);
System.out.println("end release resources") ;
}
And this is in NioServerSocketChannelFactory.
Mike
On Sep 9, 2009, at 10:09 AM, Thomas Bocek wrote:
> Michael McGrady wrote:
>> I am not getting a return from the NeoServerSocketChannelFactory's
>> releaseExternalResources method. Is this something anyone else has
>> seen? This is very surprising to me because this is just in
>> essence a
>> return from the ExecutorUtil terminate method which just copies and
>> shuts down the copies as ExecutorServices shutdown method. There
>> should be only a 100 millisecond wait in that method.
>
> The awaitTermination() call may return false, so it will wait longer
> than 100msec.
>
>> Any ideas?
>
> Make sure you have closed all connections before calling
> releaseExternalResources. You can use the ChannelGroup to group
> channels
> and close them with ChannelGroup.close().
>
> Thomas
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
Mike McGrady
Principal Investigator AF081-028 AFRL SBIR
Senior Engineer
Topia Technology, Inc
1.253.720.3365
mmcgrady at topiatechnology.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20090909/33c25600/attachment-0001.html
More information about the netty-users
mailing list