Hi,

while hunting down a deadlock in my code I noticed that all my
requests (those not involved in the real problem) were waiting to
enter JServServletManager.checkReload. 

checkReload would return immediately in my production environment as
it sets autoreload.classes and autoreload.file to false for all zones
(I think most production environments apply similar strategies).

So I came up with something like this

-------------------------Snip-----------------------------------------------

*** JServConnection.java        Tue Jan 18 13:18:52 2000
--- JServConnection.java.orig   Tue Jan 18 13:16:54 2000
***************
*** 250,267 ****
              }
          }
  
!         if (mgr.checkClasses || mgr.checkFile) {
!             try {
!                 // Let the mgr check for changes.
!                 mgr.checkReload(this);
!             } catch (IllegalArgumentException ex) {
!                 // this exception may be thrown by JServClassLoader when
!                 // it's repository was altered in a dangerous way
!                 // (removed directories or zip/jar files; corrupted zip/jar
!                 // archives etc.)
!                 sendError(ex);
!                 return;
!             }
          }
  
          try {
--- 250,265 ----
              }
          }
  
!         try {
!             // Let the mgr check for changes.
!             mgr.checkReload(this);
!         } catch (IllegalArgumentException ex) {
!             // this exception may be thrown by JServClassLoader when
!             // it's repository was altered in a dangerous way
!             // (removed directories or zip/jar files; corrupted zip/jar
!             // archives etc.)
!             sendError(ex);
!             return;
          }
  
          try {
-------------------------Snip-----------------------------------------------

i.e. if both checkClasses and checkFiles are false donīt even bother
to call checkReload (and donīt try to acquire the monitor on mgr).

Iīm not familiar enough with Jserv to see all side effects this might
have at first glance. From my understanding:

1. checkFile == false && checkClasses == false 

   This condition will always remain true. We never call checkReload.

2. checkFile == false && checkClasses == true 

   This condition will always remain true. We add a single conditional 
   to each call of processRequest, nothing else changes.

The cases with checkFile == true are similar to 2 with the exception
that the condition may change when JServ reloads the zone
configuration file. This means there is a race condition but as far as 
I can tell this cannot do any harm as almost the same condition is
evaluated inside of checkReload again.

Did I miss something obvious?

        Stefan


--
----------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to