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

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0, 0.11.0
    • Fix Version/s: None
    • Component/s: Appender
    • Labels:
      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              robbl Robert Luberda
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: