tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 38483] access log valve uses simpledateformat in tread-unsafe way
Date Fri, 04 Apr 2008 12:26:41 GMT

--- Comment #9 from Peter Rossbach <>  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(dayFormatter.format(date));           // Day
            result.append(lookup(monthFormatter.format(date))); // Month
            result.append(yearFormatter.format(date));          // Year
            result.append(timeFormatter.format(date));          // Time
            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!


Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message