Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-246

UDP socket Appender error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-beta5
    • 2.0-beta7
    • Appenders, Core
    • None

    Description

      On 2013/05/09, at 18:34, Tomek Kaczynski <tomek.kaczynski@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 .

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rpopma Remko Popma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: