Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
The thread blocked when audit log boom show in above.
Such as https://dzone.com/articles/log4j-thread-deadlock-case , it seems the same case when heavy load, should we update to Log4j2 or other things we can do to improve it in heavy audit log.
/** Call the appenders in the hierrachy starting at <code>this</code>. If no appenders could be found, emit a warning. <p>This method calls all the appenders inherited from the hierarchy circumventing any evaluation of whether to log or not to log the particular log request. @param event the event to log. */ public void callAppenders(LoggingEvent event) { int writes = 0; for(Category c = this; c != null; c=c.parent) { // Protected against simultaneous call to addAppender, removeAppender,... synchronized(c) { if(c.aai != null) { writes += c.aai.appendLoopOnAppenders(event); } if(!c.additive) { break; } } } if(writes == 0) { repository.emitNoAppenderWarning(this); } }
The log4j code, use the global synchronized, it will cause this happened.
Attachments
Attachments
Issue Links
- is related to
-
HADOOP-16206 Migrate from Log4j1 to Log4j2
- Open