You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2009/07/22 17:23:50 UTC

DO NOT REPLY [Bug 41214] Deadlock with RollingFileAppender

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


satesh.x.anumala@chase.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|Sun                         |All
         OS/Version|Solaris                     |Linux




--- Comment #28 from satesh.x.anumala@chase.com  2009-07-22 08:23:42 PST ---
Hi 

We are using Log4j 1.2_14 under jboss environment (i.e log4j-boot.jar).
Frequent jvm crashes are happening in high production environments because of
Log4j RollingFileAppender. 

Log Level is DEBUG.

Here is the stack trace:

Thread: http-0.0.0.0-8080-4 : priority:5, demon:true, threadId:104,
threadState:BLOCKED,
lockName:org.jboss.logging.appender.RollingFileAppender@718bc0c4

               
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:210)
               
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
                org.apache.log4j.Category.forcedLog(Category.java:388)
                org.apache.log4j.Category.info(Category.java:663)


Applied patch proposed by http://marc.info/?l=log4j-dev&m=121271153819013&w=2
but still problem  doesn't solved.

This is the problem with synchronization and multiple threads like 5000 or more
per sec (in production)trying to access the application and respective log
statements will be called for each thread. 

Our application strictly enforces using smartDebug, smartError, smartInfo
etc...  

Tried using AysncAppender with the above patch. It solved the synchronization
problem in callAppenders() method but now AppenderSkeleton's doAppend() is
synchronized.

org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:231)
               
org.apache.log4j.helpers.AppenderAttachableImpl5.appendLoopOnAppenders(AppenderAttachableImpl5.java:79)
                org.apache.log4j.Category.callAppenders(Category.java:203)
                org.apache.log4j.Category.forcedLog(Category.java:387)
                org.apache.log4j.Category.info(Category.java:662)

For sure this is a synchronization problem irrespective on which application
sever you are using. Synchronization needs to be moved to lower level i.e
(append method).

Jboss tightly integrates log4j and applying patch is also cumbersome.

Before posting here tried every single option to solve the issue but no luck.

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org