tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38795] - StandardContext doesn't always reset thread's contextClassLoader
Date Thu, 16 Mar 2006 04:38:43 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38795>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38795





------- Additional Comments From darryl@darrylmiles.org  2006-03-16 04:38 -------
Created an attachment (id=17909)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17909&action=view)
Defensive coding patch for all bind/unbind usage NEEDS PEER REVIEW

This is a patch base on a code walk (rather than a full understanding of the
code) and some re-work to eliminate potential problem that seem possible from
the perspective of that code walk.

Namely protection from Exception generation at the wrong moment between
bind/unbind calls.


There are two minor changes in behaviour with this patch, which I think are
more correct than the original (but then I didn't take the time the fully
understand the code so please excuse me).

#start() around line 4063 if ok==false we don't call bindThread() now.	Since
the only way we get to call unbind is in the finally block within the if(ok)
condition.  The means the code around line 4155 to 4166 may or may not be in
bound state, depending upon ok==true|false, was this originally intended ?

#start() around line if unbindThread(oldCC) were to throw an exception, before
we would call unbindThread(oldCC) again, twice in a row, maybe this is safe
anyway but now we only call it the once.

#stop() as the bug report suggests wrapping all the calls within the try block
make defensive sense to me.


Other than that for the normal code path execution should be the same as
before, but nows its very easy to see from the code that flipping between bind
and unbind is better protected from exceptions.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message