Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-415

RemoteSyslogAppender may block for ARP resolution + Improvement Strict RFC3164

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.13
    • None
    • Appenders
    • Any Windows environment

    Description

      Sending UDP packages may block for some time in specific circumstances:
      1) Next hop in network level 3 can't be resolved by ARP.
      2) Datagram size exceeds FastSendDatagramThreshold configured size.

      When sending packets bigger than FastSendDatagramThreshold, the OS waits until the packet is actually sent, if the If the syslog (or the next hop to reach the syslog) is in the same VLAN/Subnet the OS tries to resolve by ARP the Ip of the configured syslog, this may take up to 3 seconds, slowing down the whole application, which in some cases can lead to outages (timeouts, DB locks...).

      Also the fact that each carriage return generates the headers of the packet again, that can lead to a significant overhead in some scenarios, for instance when loggign HTTP requests to a remote syslog, every header will go in a different message. Also some logging may require characters that are now skipped in patch: https://issues.apache.org/jira/browse/LOG4NET-370

      I'm adding a patch that
      1) Moves the use of UDPClient to Non blocking sockets, which eliminates the blocking.
      2) Adds a configuration field to decide if you want Strict RFC Behaviour or not (with default Strict).

      Please your feedback, thanks in advance

      Jose Luis

      Attachments

        1. RemoteSyslogNonBlockingV3.patch
          8 kB
          Jose Luis Pedrosa
        2. RemoteSyslogNonBlockingv2.patch
          6 kB
          Jose Luis Pedrosa
        3. MessageLostTestAsync.cs
          2 kB
          Dongsheng Song
        4. MessageLostTest.cs
          2 kB
          Dongsheng Song
        5. MessageLostTest.cs
          1 kB
          Dongsheng Song
        6. LOG4NET-415.patch
          6 kB
          Jose Luis Pedrosa

        Activity

          People

            Unassigned Unassigned
            jlpedrosa Jose Luis Pedrosa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: