DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23912>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23912 AsyncAppender.getBufferSize() is not properly synchronized Summary: AsyncAppender.getBufferSize() is not properly synchronized Product: Log4j Version: 1.2 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Appender AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] The method getBufferSize in AsyncAppender acquire the lock on the BoundedFIFO object before invoking getMaxSize() on it. In general, the BoundedFIFO class requires that clients of the class acquire the lcok on the object before invoking its methods. The one exception is the method resize(), which is already declared to be synchronized. This mixing of conventions is confusing in general. In this case, there isn't any real damage that can be caused by this unsynchronized access to the BoundedFIFO object, but the access does appear to violate the intended usage convention and thus can be cause further confusion down the road. In summary, change AsyncAppender.getBufferSize() to be: public int getBufferSize() { synchronized( bf ) { return bf.getMaxSize(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]