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

Jose Luis Pedrosa commented on LOG4NET-415:
-------------------------------------------

Hi Stefan

Acording to your request:
* Non async has not been used.
* Added non blocking option, with name *"NonBlockingSocket"* defaulting to 
false (to blocking), to get the same behaviour as in previous versions, this 
setting has been done at UdpApenderLevel. Also added comments about the 
possibility of lossing messages in high send rates.
* Renamed the *StrictRFC3164* to *NonASCIISplitNewLine*, not sure if it´s a 
good name, I can´t find a better one, but the need to express "Don´t send ASCII 
characters and split messages by new line" in a short variable. Please feel 
free to use any name if you find a better one.Also a short description has been 
added.

To write a unit test for the non blockign part it´s not easy at all, the best 
way is how I detected it (by sending the message to any endpoint that is not 
available at L2), and if it takes more than 1 second, it´s blocking. Whow to 
find that host not available by code? not easy... I tried ips in the loopback 
interface subnet, but it replies to everything ) (ie: 127.0.0.2).

Please let me know if I can do anything else.

Best regards.

JL

> RemoteSyslogAppender may block for ARP resolution + Improvement Strict RFC3164
> ------------------------------------------------------------------------------
>
>                 Key: LOG4NET-415
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-415
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: Any Windows environment
>            Reporter: Jose Luis Pedrosa
>              Labels: RemoteSyslogAppender
>         Attachments: LOG4NET-415.patch, MessageLostTest.cs, 
> MessageLostTest.cs, MessageLostTestAsync.cs, RemoteSyslogNonBlockingV3.patch, 
> RemoteSyslogNonBlockingv2.patch
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to