fhanik      2004/01/14 21:29:06

  Modified:    modules/cluster/src/share/org/apache/catalina/cluster/session
                        DeltaManager.java DeltaSession.java
  Log:
  small fixes
  
  Revision  Changes    Path
  1.8       +22 -7     
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DeltaManager.java 15 Jan 2004 04:19:50 -0000      1.7
  +++ DeltaManager.java 15 Jan 2004 05:29:05 -0000      1.8
  @@ -479,6 +479,9 @@
                       DeltaSession session = getNewDeltaSession();
                       session.readObjectData(ois);
                       session.setManager(this);
  +                    session.setValid(true);
  +                    session.setPrimarySession(false);
  +                    session.access();
                       sessions.put(session.getId(), session);
                   }
               } catch (ClassNotFoundException e) {
  @@ -660,6 +663,14 @@
                                          SessionMessage.EVT_GET_ALL_SESSIONS,
                                          null,
                                          "GET-ALL");
  +                //just to make sure the other server has the context started
  +//                long timetowait = 20000-mbr.getMemberAliveTime();
  +//                if ( timetowait > 0 ) {
  +//                    log.info("The other server has not been around more than 20 
seconds, will sleep for "+timetowait+" ms. in order to let it startup");
  +//                    try { Thread.currentThread().sleep(timetowait); } catch ( 
Exception x ) {}
  +//                }//end if
  +                
  +                //request session state
                   cluster.send(msg, mbr);
                   log.warn("Manager["+getName()+"], requesting session state from 
"+mbr+
                            ". This operation will timeout if no session state has 
been received within "+
  @@ -712,6 +723,7 @@
   
           // Expire all active sessions
           if ( this.getExpireSessionsOnShutdown() ) {
  +            log.info("Expiring sessions upon shutdown");
               Session sessions[] = findSessions();
               for (int i = 0; i < sessions.length; i++) {
                   DeltaSession session = (DeltaSession) sessions[i];
  @@ -884,9 +896,12 @@
                      case SessionMessage.EVT_SESSION_DELTA : {
                          byte[] delta = msg.getSession();
                          DeltaSession session = 
(DeltaSession)findSession(msg.getSessionID());
  -                       DeltaRequest dreq = loadDeltaRequest(session,delta);
  -                       dreq.execute(session);
  -                       session.setPrimarySession(false);
  +                       if (session != null) {
  +                           DeltaRequest dreq = loadDeltaRequest(session, delta);
  +                           dreq.execute(session);
  +                           session.setPrimarySession(false);
  +                           session.access();
  +                       }
                          
                          break;
                      }
  
  
  
  1.9       +7 -5      
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java
  
  Index: DeltaSession.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DeltaSession.java 13 Jan 2004 05:26:59 -0000      1.8
  +++ DeltaSession.java 15 Jan 2004 05:29:06 -0000      1.9
  @@ -641,7 +641,9 @@
                   expire(true);
               } else if ( timeIdle >= (2*maxInactiveInterval) ) {
                   //if the session has been idle twice as long as allowed,
  -                //the primary session has probably crashed
  +                //the primary session has probably crashed, and no other
  +                //requests are coming in. that is why we do this. otherwise
  +                //we would have a memory leak
                   expire(true);
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to