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 14:47:03 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=38483





--- Comment #12 from Niall Pemberton <niallp@apache.org>  2008-04-04 07:47:02 PST ---
I don't see that theres a problem any more - the block that uses most (i.e. all
except fileDateFormatter) of the SimpleDateFormats is now in a synchronized
block:

    synchronized (this) {
        if (currentDate != date) {
            StringBuffer current = new StringBuffer(32);
            current.append('[');
            current.append(dayFormatter.format(date)); // Day
            current.append('/');
            current.append(lookup(monthFormatter.format(date))); // Month
            current.append('/');
            current.append(yearFormatter.format(date)); // Year
            current.append(':');
            current.append(timeFormatter.format(date)); // Time
            current.append(' ');
            current.append(getTimeZone(date)); // Timezone
            current.append(']');
            currentDateString = current.toString();
            currentDate = date;
        }
    }

...and fileDateFormatter is used in the rotate() method which is also
synchronized

Looks to me like this was resolved in the following revision:
http://svn.apache.org/viewvc?view=rev&revision=494191

But perhaps I'm looking at the wrong version - as code I see differs from what
Peter quotes (StringBuffer is called current rather than result)


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