DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42171>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42171

           Summary: SocketHubReceiver duplicates messages
           Product: Log4j
           Version: 1.3alpha
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Other
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


When shutting down and then restarting a SocketHubReceiver, it can start two 
connector threads to the 
same server.  This can result in multiple active connections, which causes 
messages to be recorded by 
the receiver twice.  I will attach code that reproduces this bug.

When the current connection is shut down, and Exception occurs that triggers 
the creation of a new 
connection that ignore the fact that a new Connector was already created by the 
restart.  Both 
Connectors can succeed.

Removeing the follwing code that ignores existing Connectors when the Exception 
is thrown stops this 
behavior:

<pre>
      // we clear the connector object here
      // so that it actually does reconnect if the
      // remote socket dies.
      connector = null;
</pre>

My reading of the code leads me to believe that this line was put in before 
connections were started in 
Threads and is not necessary.  If I am incorrect, then a more serious rewriting 
of the class is needed to 
handle the destruction of the existing Threads before a new one is created.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to