You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Robert Middleton (Jira)" <lo...@logging.apache.org> on 2021/12/27 00:34:00 UTC

[jira] [Updated] (LOGCXX-337) Suggested fix for socketappender not reconnecting multiple times

     [ https://issues.apache.org/jira/browse/LOGCXX-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Middleton updated LOGCXX-337:
------------------------------------
    Fix Version/s: 0.13.0

> Suggested fix for socketappender not reconnecting multiple times
> ----------------------------------------------------------------
>
>                 Key: LOGCXX-337
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-337
>             Project: Log4cxx
>          Issue Type: Improvement
>          Components: Appender
>    Affects Versions: 0.10.0
>         Environment: Linux
>            Reporter: Ajay Dhawale
>            Assignee: Curt Arnold
>            Priority: Major
>             Fix For: 0.13.0
>
>         Attachments: log4cxx-fix-socket-thread-not-starting-many.patch
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)