You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Slavik Lazor <sl...@i-hypergrid.com> on 2004/07/04 22:37:41 UTC

tomcat stuck

HI,

I worked with tomcat 4.1.12 and I've got the following situation.


Method org.apache.tomcat.util.threads.ThreadPool.ControlRunnable.run()
...
} catch(Throwable t) {
	loghelper.log("Caught exception executing " + toRun.toString() + ",
terminating thread", t);
	loghelper.flush();
	shouldTerminate = true;
      shouldRun = false;
	p.notifyThreadEnd(this);
} finally {
	if(shouldRun) {
		shouldRun = false;
		p.returnController(this);
	}
}


If loghelper.log will thrown an exception, this is possible if we add custom
handler to default logger, thread won't be released from pool and the
notification won't be performed. I have fixed the custom handler in my code
but I have another situation which makes is making the same situation.

If everything is OK there is always a thread which invokes socketAccept
method of the http serverSocket. But there are situation when this thread
dies and tomcat is stuck. Even if it dies there should be a stack trace of
the exception, logged in java.lang.ThreadGroup.uncaughtException, that
caused the death.

...
	if (!(e instanceof ThreadDeath)) {
	    e.printStackTrace(System.err);
	}
...
But there's none.
So I am wandering, where else can be that socket losing code.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org