Any feedback on these issues? I submitted Jira issues on all 3.

The threads not ending cleanly is a major problem with me trying to
move one component of our system to Log4Cxx. I would at least like to
get a patch for it (preferrably a released version). I've tried
several things but have not found a complete solution and the fact
that it behaves differently than the FileWatchdog thread is confusing.
I'm willing to help out on it, but am interested in your thoughts on
the threading issues since you wrote it.

On Thu, May 1, 2008 at 10:59 PM, Dale King <[EMAIL PROTECTED]> wrote:
> ReconnectionDelay is not working for XMLSocketAppender. This method is
>  backwards:
>
>  void SocketAppenderSkeleton::fireConnector()
>  {
>         synchronized sync(mutex);
>         if (thread.isActive()) {
>                 thread.run(monitor, this);
>         }
>  }
>
>  You need a ! on the if condition,
>
>  I was also playing around with using TimeBasedRollingPolicy as a
>  TriggeringPolicy for rolling a file, but using a
>  FixedWindowRollingPolicy as the RollingPolicy. This did not work as I
>  expected. every logging event was triggering rollover so every file
>  contained only 1 log event. This is because lastFileName is only
>  updated in the rollover method
>
>  I'm not sure this is supposed to be supported, but it would seem like
>  it should work. This also means that using TimeBasedRollingPolicy to
>  trigger a SMTPAppender will not work correctly and will flood your
>  inbox with an email for every message!
>
>  Also on Windows when I have other threads running like the one to do
>  reconnection to a socket then my app does not shut down cleanly. When
>  it ends I get this message on the console:
>
>  This application has requested the Runtime to terminate it in an unusual way.
>  Please contact the application's support team for more information.
>
>  and I get an unknown software exception (0x40000015).
>
>  If I add an XMLSocketAppender (with the fix from above so the thread
>  actually runs) and the thread is sleeping then when main exits there
>  is a delay (equal to the reconnectionDelay) then the exception occurs.
>  I think the problem is that the SocketAppender is destroyed but the
>  monitor thread is continuing to sleep when it wakes up it is not
>  checking if it was interrupted like FileWatchdog does.
>
>  I can get rid of the exception by doing a thread.join in the close
>  method and changing the monitor code to check for being interrupted
>  like this:
>
>                         Thread::sleep(socketAppender->reconnectionDelay);
>                         if( !socketAppender->thread.interrupted() )
>                         {
>
>  LogLog::debug(LogString(LOG4CXX_STR("Attempting connection to "))
>                                     + socketAppender->address->getHostName());
>                             socket = new
>  Socket(socketAppender->address, socketAppender->port);
>                             Pool p;
>                             socketAppender->setSocket(socket, p);
>                             LogLog::debug(LOG4CXX_STR("Connection
>  established. Exiting connector thread."));
>                         }
>                         return NULL;
>
>  But that does not get rid of the delay waiting for the sleep to end. I
>  don't understand why the sleep is not interrupted in this thread, but
>  FileWatchdog does not have the same problem. The call to sleep from
>  FileWatchdog does not keep the app from exiting.
>
>  I hope you're planning on a 0.10.1 version soon.
>
>  --
>  Dale King
>



-- 
Dale King

Reply via email to