Robert Luberda created LOGCXX-432:
-------------------------------------

             Summary: AsyncAppender automatically switches to sync mode when 
e.g. there is no disk space available
                 Key: LOGCXX-432
                 URL: https://issues.apache.org/jira/browse/LOGCXX-432
             Project: Log4cxx
          Issue Type: Bug
          Components: Appender
    Affects Versions: 0.10.0, 0.11.0
            Reporter: Robert Luberda


When there is no available disk space an exception is thrown. The exception 
causes AsyncAppender thread to exit, see line 362 of 
http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/asyncappender.cpp?revision=1554780&view=markup
After the thread exits, the append() method starts working synchronously, see 
lines 101 to 109 of the file.

Obviously when disk is still full, the next call to append(), after it switched 
to sync mode,  will still throw an exception. However an application can catch 
and ignore it in order to continue working without any logging (as logging is 
not as important as having the service provided by the application available 
for users). 

 After some time the disk space may be cleaned up, but unfortunately our 
program uses synchronized logging, which may affect its performance, because of 
waits on I/O inside log4cxx.

So please fix this issue by:
- ensuring the dispatcher thread won't exit on exception (which is quite 
simple, just move the try/catch inside the while loop), 
- and maybe restarting the dispatcher if it dies instead of using sync logging 
(or maybe just ignoring logging/doing nothing if dispatcher dies?)










--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to