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=34541>.
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=34541

           Summary: hang on shutdown - countAllocated not synchronized
           Product: Tomcat 4
           Version: 4.0.6 Final
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: major
          Priority: P1
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


This may be a problem in Tomcat 5.X too. We are seeing hangs during shutdown of 
Tomcat. The localhost_log shows a last line of "2005-04-20 06:03:06 
StandardWrapper[/TomcatHang:hangServlet]: Waiting for 2 instance(s) to be 
deallocated". A thread dump shows the main thread waiting at "at 
org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1074)". 
There are no HTTP processor threads running - they have all shutdown. 
Inspecting the code shows unload waiting for the variable countAllocated to go 
to zero. However, the code that increments and decrements countAllocated for 
non-single-threaded servlets is not synchronized, so the value will not be 
correct in some cases. To test this I added synchronized blocks to the 
increment/decrement code and no longer get hangs.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to