[ 
https://issues.apache.org/jira/browse/LOG4J2-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13653117#comment-13653117
 ] 

Gary Gregory commented on LOG4J2-246:
-------------------------------------

I have refactored some TCP socket tests in order to test this issue. We now 
have an abstract test class with subclasses for TCP and UDP.

The problem is that there are some odd errors in the new UDP tests that are 
@Ignore for now. 

>From the debugger I see one log event properly marshaled and marshaled but for 
>a second I get an exception.

>From Eclipse, running the test 
>org.apache.logging.log4j.core.net.UDPSocketServerTest, I get:

java.io.StreamCorruptedException: invalid stream header: 7372003E
        at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
        at java.io.ObjectInputStream.<init>(Unknown Source)
        at 
org.apache.logging.log4j.core.net.UDPSocketServer$DatagramPacketHandler.<init>(UDPSocketServer.java:167)
        at 
org.apache.logging.log4j.core.net.UDPSocketServer.run(UDPSocketServer.java:140)
        at java.lang.Thread.run(Unknown Source)
Exception encountered on accept. Ignoring. Stack Trace :
 

For these I am seeking help.

See: 

commit -m "Testing LOG4J2-246: UDP socket Appender error. Needing help with 
UDPSocketServerTest, it is @Ignored for now." 
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/UDPSocketServerTest.java
 
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/TCPSocketServerTest.java
 
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java
 
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/UDPSocketServer.java
 
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java
    Adding         
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/AbstractSocketServerTest.java
    Deleting       
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/SocketServerTest.java
    Adding         
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/TCPSocketServerTest.java
    Adding         
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/UDPSocketServer.java
    Adding         
C:/svn/org/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/net/UDPSocketServerTest.java
    Transmitting file data ...
    Committed revision 1480747.


                
> UDP socket Appender error
> -------------------------
>
>                 Key: LOG4J2-246
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-246
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders, Core
>    Affects Versions: 2.0-beta5
>            Reporter: Remko Popma
>
> On 2013/05/09, at 18:34, Tomek Kaczynski <tomek.kaczyn...@gmail.com> wrote:
> Hi All,
>    I'm using log4j2 since beta4, now beta5. In general it's a cute library, 
> but there's some bug that I've found out recently :
>    When a client code genreates a huge message ( 64k ), the underlying 
> DatagramOutputStream fails ( UDP socket throws exception).
>   After that all following flushes fail because data buffer is not cleared 
> upon exception.
>  So in lines
> DatagramOutputStream:91
> ----------------------------------------------------------------------
>     public synchronized void flush() throws IOException {
>         if (this.data != null && this.ds != null && this.address != null) {
>             final DatagramPacket packet = new DatagramPacket(data, 
> data.length, address, port);
>             ds.send(packet);
>         }
>         data = null;
>     }
> --------------------------------------------------------------------------
>    
> data = null should be put in finally block or some simillar solution could be 
> applied.
> What do you think ?
> Regards,
> Tomek
> Moreover DatagramOutputStream should check if message size is less then 64k .

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to