2012/4/6 Ofer Israeli <of...@checkpoint.com>: > Hi Konstantin, > > I agree regarding the OOM bringing TC to a state where it must be restored, > but my point remains: if there is code that handles catching this exception > and terminating the thread, why not terminate gracefully by closing the > listening socket before killing the thread? >
1. In theory one can configure several acceptor threads. Though it is not recommended. So one has to check the count before closing the socket. 2. The socket will be closed when Tomcat shuts down. Just closing the socket - what will it improve? Anyway you will need to shutdown this Tomcat instance before you can start the second one, because you'll need to free the shutdown port etc. > if there is code that handles catching this exception and terminating the > thread 3. There is no such special code. The thread terminates by itself, because its run() throws an exception and thus finishes execution. There is ThreadGroup.uncaughtException() method in JRE which by default prints the exception to stdout. If you consider to propose a patch - feel free to file an enhancement request in Bugzilla and attach it. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org