Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-432

AsyncAppender automatically switches to sync mode when e.g. there is no disk space available

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.0, 0.11.0
    • 1.0.0
    • Appender
    • None

    Description

      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?)

      Attachments

        Issue Links

          Activity

            People

              swebb2066 Stephen Webb
              robbl Robert Luberda
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: