https://issues.apache.org/bugzilla/show_bug.cgi?id=55987
Bug ID: 55987
Summary: Extras RollingFileAppender is hanging application
while rollover is running
Product: Log4j
Version: 1.2.17
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P2
Component: Appender
Assignee: [email protected]
Reporter: [email protected]
org.apache.log4j.rolling.RollingFileAppender is hanging application while
rollover is running. This situation is noticable when the log file is very
large, e.g. application is freezing for about 5 minutes when the log file has
20GB data.
The problem is that the methods run() and close() in ActionBase
class(GZCompressAction and ZipComressAction inherit from it) are synchronized.
Rollover() in RollingFileAppender is executing for each append event and that
method checks if the action is still running. If yes, it calls close() on that
action but it will never happen because run and close are synchronized. So
application is freezing for time while the log file is rolling.
Here is a fragment from RollingFileAppender:
//
// block until complete
//
lastRolloverAsyncAction.close();
//
// or don't block and return to rollover later
//
//if (!lastRolloverAsyncAction.isComplete()) return false;
As we can see someone thought about it. If we comment close and uncomment
isComplete everything looks ok.
Might it make sense to change it in next version or whether this change will
cause other problems?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]