You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2007/11/03 15:09:17 UTC

DO NOT REPLY [Bug 43790] New: - concurrent access issue on TagHandlerPool

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

           Summary: concurrent access issue on TagHandlerPool
           Product: Tomcat 6
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: michael.mao@achievo.com


when doing performance test, i found the concurrent acess lock issue about JSP 
tag. Many threads are waiting for TagHandlerPool object, such as 
TagHandlerPool.reuse, TagHandlerPool.get. 
In TagHandlerPool and PerThreadTagHandlerPool class, object pool was used, but 
its synchronization cause the thread waiting/lock issue when a lot of JSP tags 
are using. Later, I test a ThreadLocal based TagHandler object instead of 
TagHandlerPool, the response time was reduced to 5s from 30s against 50 
concurrent user. 
As a suggestion, please remove object pool to replace with simple ThreadLocal 
solution. The same issues exist both Tomcat 5.X and 6.0.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43790] - concurrent access issue on TagHandlerPool

Posted by bu...@apache.org.
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=43790>.
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=43790





------- Additional Comments From michael.mao@achievo.com  2008-01-18 01:37 -------
Created an attachment (id=21404)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21404&action=view)
Simple threadLocal based TagHandler


-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43790] - concurrent access issue on TagHandlerPool

Posted by bu...@apache.org.
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=43790>.
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=43790


markt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement




------- Additional Comments From markt@apache.org  2008-01-01 09:44 -------
I am marking this as an enhancement.

Could you clarify how your solution is different to the PerThreadTagHandlerPool?

If you attach our proposed solution to this bug then it will be reviewed for
inclusion.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43790] - concurrent access issue on TagHandlerPool

Posted by bu...@apache.org.
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=43790>.
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=43790


michael.mao@achievo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From michael.mao@achievo.com  2008-01-10 03:25 -------
(In reply to comment #1)
> I am marking this as an enhancement.
> Could you clarify how your solution is different to the 
PerThreadTagHandlerPool?
> If you attach our proposed solution to this bug then it will be reviewed for
> inclusion.

With threadLocal variable, we don't need to create object pool again.
There is the following code snippet for your reference.
    private ThreadLocal<Tag> perThread = new ThreadLocal<Tag>();
    protected void init(ServletConfig config) 
    {
    }
    public Tag get(Class handlerClass) throws JspException 
    {
    	Tag jspTag = perThread.get();
    	if (jspTag == null)
    	{
            try 
            {
            	jspTag = (Tag) handlerClass.newInstance();
            	perThread.set(jspTag);
            } 
            catch (Exception e) 
            {
                throw new JspException(e.getMessage(), e);
            }
		}
    	else
    	{
    		//System.out.println("Reset tag:" + handlerClass);
    		jspTag.release();
    	}
    	return jspTag;
    }
    public void reuse(Tag handler) 
    {
    	//Do nothing.
    }
    public void release() 
    {
    	//Do nothing.
    }


-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org