If 'closeImmediately' in this line:
CloseFuture closeFuture = getSession().close(closeImmediately);
resolves to false, I have observed Mina to leave behind a couple threads
in WAIT states that in my experience never came out of that state. In
my case, changing the getSession().close(false) to
getSession().close(true) stopped that problem dead in its tracks.
boB
David Rosenstrauch wrote:
Adam Brown wrote:
I'm trying to modify our server to allow a message to cause it to
clean up
and exit. Currently, I've got code in our IoHandler that receives the
message and cleans up 'everything else', but when I try to unbind() the
IoAcceptor, the thread exits and leaves the connection unclosed (ie: the
telnet session I am testing with remains open). Additionally, I
still see a
couple of MINA-related threads running (and NioProcessor thread & some
thread-pool threads).
What am I missing? Am i going about this the wrong way?
-adam
I basically do shutdown same as you. Only difference is that I close
the open session first:
public class ShutdownCommand extends TextProtocolCommand {
...
public ProtocolResponse execute() throws Exception {
...
CloseFuture closeFuture = getSession().close(closeImmediately);
closeFuture.addListener(new CloseSessionListener());
return null;
}
...
class CloseSessionListener implements IoFutureListener<CloseFuture> {
public void operationComplete(CloseFuture future) {
getServerControl().shutDown();
}
}
}
public class CacheServer implements CacheServerControl {
...
public void shutdown() {
logger.debug("{} protocol processor shutting down server
socket", protocolType);
protocolAcceptor.unbind();
protocolAcceptor.dispose();
}
private String protocolType;
private SocketAcceptor protocolAcceptor;
private Logger logger;
}
Maybe try doing a thread dump and see where in the code the remaining
threads are hanging.
HTH,
DR
--
boB Gage
Software Engineer
Merge Healthcare
This message is a PRIVATE communication. This message and all
attachments are a private communication and may be confidential or
protected by privilege. If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of the
information contained in or attached to this message is strictly
prohibited. Please notify the sender of the delivery error by replying
to this message, and then delete it from your system. Thank you.