tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Hanna <Phil.Ha...@sas.com>
Subject [Patch] fix for Bug #7 - org.apache.tomcat.core.ServletWrapper - UnavailableException being ignored
Date Fri, 04 Aug 2000 10:46:45 GMT
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
UnavailableException.

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
+++ ServletWrapper.java 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 );

Mime
View raw message