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 38483] access log valve uses simpledateformat in tread-unsafe way
Date Fri, 04 Apr 2008 12:26:41 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=38483





--- Comment #9 from Peter Rossbach <pr@objektpark.de>  2008-04-04 05:26:40 PST ---
The question is also: How we can fix it:
Critical section at AccessLogValve is (LL 581 (current tomcat 5.5 trunk): 
            result.append("[");
            result.append(dayFormatter.format(date));           // Day
            result.append('/');
            result.append(lookup(monthFormatter.format(date))); // Month
            result.append('/');
            result.append(yearFormatter.format(date));          // Year
            result.append(':');
            result.append(timeFormatter.format(date));          // Time
            result.append(space);
            result.append(getTimeZone(date));                   // Time Zone
            result.append("] \"");

Not only the timeFormatter is the problem :-(

Option to fix:
a) synchronize the complete formatter access
 easy to implement, but can be a performance problem
b) use a cache with some threadLocals
 can be a memory leak at shrinking request thread pools
c) use some formatter object pools
 little implementation overhead and we must also use a sync datastructure!

Peter


-- 
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


Mime
View raw message