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

Suggested fix for socketappender not reconnecting multiple times

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.0
    • 0.13.0
    • Appender
    • None
    • Linux

    Description

      Hi,

      In an application we're building using log4cxx socketappender, we noticed that it re-connects to remote server only once.

      This seems due connector thread's status remaining active with main even after the former exits upon successfully re-connecting the first time. Consequently, SocketAppenderSkeleton::fireConnector() does not invoke 'thread.run(monitor...);' when the remote server goes down the second time.

      Modifying this function as below in v 0.10.0 code at http://www.apache.org/dyn/closer.cgi/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.tar.gz works

      void SocketAppenderSkeleton::fireConnector()
      {
      synchronized sync(mutex);
      if (thread.isActive())

      { thread.join(); }

      thread.run(monitor, this);

      }

      Perhaps the same can be replaced in the latest source (I looked at revision 788304) instead of current (partial fix?) it has "if (!thread.isActive())..."

      Wonder if someone could validate and if sounds fine we could incorporate the same.

      Thanks,

      • Ajay.

      Attachments

        Issue Links

          Activity

            People

              carnold@apache.org Curt Arnold
              dhawale_a Ajay Dhawale
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: