improved ThreadDeath handling

This commit is contained in:
Greg Wilkins 2011-11-10 12:40:29 +11:00
parent 7a9b8f1e9d
commit e3cf7a8898
7 changed files with 30 additions and 22 deletions

View File

@ -142,13 +142,14 @@ public class AsyncHttpConnection extends AbstractHttpConnection implements Async
progress=true;
}
}
catch (ThreadDeath e)
{
throw e;
}
catch (Throwable e)
{
LOG.debug("Failure on " + _exchange, e);
if (e instanceof ThreadDeath)
throw (ThreadDeath)e;
failed = true;
synchronized (this)

View File

@ -143,13 +143,14 @@ public class BlockingHttpConnection extends AbstractHttpConnection
}
}
catch (ThreadDeath e)
{
throw e;
}
catch (Throwable e)
{
LOG.debug("Failure on " + _exchange, e);
if (e instanceof ThreadDeath)
throw (ThreadDeath)e;
failed = true;
synchronized (this)

View File

@ -639,10 +639,12 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
{
_connection.onInputShutdown();
}
catch (ThreadDeath e)
{
throw e;
}
catch(Throwable x)
{
if (x instanceof ThreadDeath)
throw (ThreadDeath)x;
LOG.warn("onInputShutdown failed", x);
try{close();}
catch(IOException e2){LOG.ignore(e2);}

View File

@ -507,11 +507,12 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
{
LOG.ignore(e);
}
catch (ThreadDeath e)
{
throw e;
}
catch (Throwable e)
{
if (e instanceof ThreadDeath)
throw (ThreadDeath)e;
if (isRunning())
LOG.warn(e);
else

View File

@ -472,11 +472,12 @@ public abstract class AbstractHttpConnection extends AbstractConnection
_request.setHandled(true);
_response.sendError(e.getStatus(), e.getReason());
}
catch (ThreadDeath e)
{
throw e;
}
catch (Throwable e)
{
if (e instanceof ThreadDeath)
throw (ThreadDeath)e;
LOG.warn(String.valueOf(_uri),e);
error=true;
_request.setHandled(true);

View File

@ -309,12 +309,13 @@ public class HashSessionManager extends AbstractSessionManager
}
}
}
catch (ThreadDeath e)
{
throw e;
}
catch (Throwable t)
{
if (t instanceof ThreadDeath)
throw ((ThreadDeath)t);
else
__log.warn("Problem scavenging sessions", t);
__log.warn("Problem scavenging sessions", t);
}
finally
{

View File

@ -805,12 +805,13 @@ public class JDBCSessionManager extends AbstractSessionManager
}
}
}
catch (ThreadDeath e)
{
throw e;
}
catch (Throwable t)
{
if (t instanceof ThreadDeath)
throw ((ThreadDeath)t);
else
LOG.warn("Problem expiring sessions", t);
LOG.warn("Problem expiring sessions", t);
}
finally
{