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 2009/05/06 00:12:47 UTC

DO NOT REPLY [Bug 47158] New: I think AccessLogValve has race condition problem

https://issues.apache.org/bugzilla/show_bug.cgi?id=47158

           Summary: I think AccessLogValve has race condition problem
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: xxd82329@gmail.com


"Double-Checked Locking" pattern is heavily used in this class, but the usage
of it in AccessLogValve has some issues of race condition judging by this
article: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

Based by this article, I think these variables in this class should be declared
as volatile to get rid of race condition: 

private volatile long currentMillis;

private volatile  Date currentDate;

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

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


DO NOT REPLY [Bug 47158] I think AccessLogValve has race condition problem

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47158

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Mark Thomas <ma...@apache.org> 2009-11-02 13:58:48 GMT ---
The remaining threading issues have been fixed and will also be in 6.0.21

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

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


DO NOT REPLY [Bug 47158] I think AccessLogValve has race condition problem

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47158





--- Comment #1 from Mark Thomas <ma...@apache.org>  2009-06-04 08:39:30 PST ---
I agree with your analysis for currentMIllis.

I disagree with your analysis for currentDate. I think we can remove all the
places this is updated except getDate() and still have the same functionality.

I also think dateStamp needs to be volatile.

Patch for the above has been committed to trunk and proposed for 6.0.x.

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

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


DO NOT REPLY [Bug 47158] I think AccessLogValve has race condition problem

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47158





--- Comment #2 from Mark Thomas <ma...@apache.org>  2009-06-12 15:38:41 PST ---
The patch has been applied to 6.0.x and will be in 6.0.21 onwards.

Filip noted in his review comments that there is also a thread safety issue
around log file rotation. This still needs to be fixed.

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

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