tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29060] New: - synchronized block too small in method createSession class session/ManagerBase.java
Date Tue, 18 May 2004 10:26:46 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29060>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29060

synchronized block too small in method createSession class session/ManagerBase.java

           Summary: synchronized block too small in method createSession
                    class session/ManagerBase.java
           Product: Tomcat 5
           Version: 5.0.24
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: rainer.jung@kippdata.de
                CC: rainer.jung@kippdata.de


Hi,

in session/ManagerBase.java in method createSession it looks like the
synchronized(sessions) block is too small.

You synchronize in order to be sure, that you use a unique new session id. But
this session id is then entered into sessions directly after the synchronized
block (call to session.setId). I think, the call to session.setId should be
moved to the end of the synchronized block, since setId calls manager.add, which
puts the session into sessions. See the diff at the end of this report.

The same holds true for the implementation inside the cluster module (method
createSession in session/DeltaManager.java and in
session/SimpleTcpReplicationManager.java).

atlas1% diff -c session/ManagerBase.java session/ManagerBase.java_patch
*** session/ManagerBase.java    Tue May  4 20:25:40 2004
--- session/ManagerBase.java_patch      Tue May 18 12:12:46 2004
***************
*** 692,700 ****
                      sessionId += '.' + jvmRoute;
                  }
              }
          }
  
-         session.setId(sessionId);
          sessionCounter++;
  
          return (session);
--- 692,700 ----
                      sessionId += '.' + jvmRoute;
                  }
              }
+             session.setId(sessionId);
          }
  
          sessionCounter++;
  
          return (session);

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


Mime
View raw message