james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/mailrepository JDBCSpoolRepository.java
Date Wed, 07 May 2003 14:35:21 GMT
noel        2003/05/07 07:35:21

  Modified:    src/java/org/apache/james/mailrepository
                        JDBCSpoolRepository.java
  Log:
  Reverted change from wait(long) to wait().  There appears to be an infrequent race condition
that leaves all threads sleeping.  Raised WAIT_LIMIT to 60 seconds to reduce overhead.
  
  Revision  Changes    Path
  1.25      +7 -7      jakarta-james/src/java/org/apache/james/mailrepository/JDBCSpoolRepository.java
  
  Index: JDBCSpoolRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/JDBCSpoolRepository.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- JDBCSpoolRepository.java	7 May 2003 06:17:10 -0000	1.24
  +++ JDBCSpoolRepository.java	7 May 2003 14:35:20 -0000	1.25
  @@ -128,7 +128,7 @@
       /**
        * How long a thread should sleep when there are no messages to process.
        */
  -    private static int WAIT_LIMIT = 1000;
  +    private static int WAIT_LIMIT = 60000;
       /**
        * How long we have to wait before reloading the list of pending messages
        */
  @@ -165,8 +165,7 @@
                       //            .append(" in ")
                       //            .append(repositoryName);
                       //System.err.println(errorBuffer.toString());
  -//                    wait(WAIT_LIMIT);
  -                    wait(); // we'll be woken by store() calling notify()
  +                    wait(WAIT_LIMIT);
                   }
               } catch (InterruptedException ex) {
                   throw ex;
  @@ -210,12 +209,13 @@
                   }
               }
               //Nothing to do... sleep!
  -//            if (sleepUntil == 0) {
  -//                sleepUntil = System.currentTimeMillis() + WAIT_LIMIT;
  -//            }
  +            if (sleepUntil == 0) {
  +                sleepUntil = System.currentTimeMillis() + WAIT_LIMIT;
  +            }
               try {
                   synchronized (this) {
  -                    long waitTime = (sleepUntil == 0) ? 0 : sleepUntil - System.currentTimeMillis();
                   //StringBuffer errorBuffer =
  +                    long waitTime = sleepUntil - System.currentTimeMillis();
  +                    //StringBuffer errorBuffer =
                       //    new StringBuffer(128)
                       //            .append("waiting ")
                       //            .append((waitTime) / 1000L)
  
  
  

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


Mime
View raw message