tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Hanna" <>
Subject Patch - fix available for Bug #7
Date Sun, 13 Aug 2000 01:23:57 GMT
I submitted this bug fix about eight days ago, both to the bug tracking system at
and to this newsgroup.  Has any committer had a chance to take a look at it?

Handling requests from a servlet that has thrown a permanent UnavailableException in init()
is clearly a bug.  The fix doesn't seem particularly dangerous.  Hasn' t anyone run into this

Throwing a permanent UnavailableException from a servlet's init() method should prevent requests
from being serviced, but it does not.  The org.apache.tomcat.core.ServletWrapper doInit()
method does not take into account that getUnavailableSeconds() returns -1 for a permanent

My fix applies to the service() method.  It already checks for the exception and retries if
the (temporary) unavailable time limit has expired.  I added code to force a return with initialized=false
if the exception is permanent.

BTW, I posted this as a comment to BugRat bug 7.  Is that the appropriate place to post a
fix?  I wasn't sure, so I posted it here as well.

--- ServletWrapper.original Tue Aug 01 03:23:30 2000 
+++ Fri Aug 04 06:12:23 2000 
@@ -353,6 +353,12 @@ 
  if( unavailable!=null  ) { 
+  // Don't load at all if permanently unavailable 
+  if (((UnavailableException) unavailable).getUnavailableSeconds() == -1) { 
+   initialized = false; 
+   return; 
+  } 
      // Don't load if Unavailable timer is in place 
      if(  stillUnavailable() ) { 
   handleUnavailable( req, res ); 


View raw message