You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Jack Warner (JIRA)" <ji...@apache.org> on 2019/05/14 15:50:00 UTC

[jira] [Commented] (LOG4NET-510) FileAppender.InterProcessLock.AcquireLock blocks everything

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

Jack Warner commented on LOG4NET-510:
-------------------------------------

I can reproduce this as well, using the latest (at this time) 2.0.8.0 version of log4net.

I can create a simple console application that spins up 3 threads each of which writes log messages for 10 seconds each simultaneously. When the log file reaches the configured rolling file size, one of the threads rolls it over and then everything hangs. So I end up with a log file whose size is 200KB (in my example I set it to roll at 200KB) rolled over to filename.log.1 and a new empty filename.log file is created but the application hangs at that point.

 

If I use MinimalLock instead, then it doesn't hang, and produces several rolled log files as expected.

> FileAppender.InterProcessLock.AcquireLock blocks everything
> -----------------------------------------------------------
>
>                 Key: LOG4NET-510
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-510
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: Windows 2012
>            Reporter: StevenXi
>            Priority: Critical
>         Attachments: screenshot-1.png
>
>
> There's a chance InterProcessLock.AcquireLock hangs, and lots of Appender.AppenderSkeleton.DoAppend threads queued.
> It happens to our service every 2 days, all happen after mid-night. So after a new log file created, few new line in the file added. But not always happens.
> As there're hundreds of Appender.AppenderSkeleton.DoAppend threads queued, it blocks everywhere in the service that uses log4net.
> log4net is supposed to be 'failure-free' or at least fails quietly, not block the whole application.
> config uses
> <lockingModel type="log4net.Appender.FileAppender+InterProcessLock" />
> So far it has hanged for few (8+) hours already.
> The attached screen shot was taken by remote debug from a server after 8+ hours of hanging.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)