You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Constantin Ungureanu (JIRA)" <ji...@apache.org> on 2016/02/11 22:40:18 UTC

[jira] [Commented] (LOG4J2-1267) AsyncLogger.stop() method is needed

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

Constantin Ungureanu commented on LOG4J2-1267:
----------------------------------------------

Hi,

I am using log4j2 for some time now, I am a supporter of it and I greatly appreciate your contribution to this project.

I have a very basic application that I developed to see how it is possible to construct discrete event simulation with very large number of actors/agents.
https://github.com/constantin-ungureanu-github/simulator-fsm.git

This basic application is done in Java, using Scala/Akka framework and also the log4j2 with the disruptor.
All the information regarding building and running are in the readme file. I am using SBT for compiling and running it.
I had tried to use the logging that comes with the Akka framework but that is just not working, memory keep increasing until reaches the limits.
https://github.com/akka/akka/issues/18544

Now, to get to your question, I am terminating the simulation with "getContext().system().terminate();", in /src/main/java/simulator/actors/Master.java.
This stops the guardian actor that will trigger all the other actors to terminate. The problem is that I have to stop the AsyncLogger before, or I get that exception as described above.

With the existing version of log4j2 (2.4.1) this works fine; if I update the build.sbt file with newer version (2.5) and rebuild I get into this issue again and I don't know how to workaround it.


> AsyncLogger.stop() method is needed
> -----------------------------------
>
>                 Key: LOG4J2-1267
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1267
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.5
>            Reporter: Constantin Ungureanu
>
> The AsyncLogger.stop() method was used to prevent the exception bellow. Now with the 2.5 version, this was removed. Is there a workaround to fix this?
> {code}
> Feb 10, 2016 8:43:59 PM com.lmax.disruptor.FatalExceptionHandler handleEventException
> SEVERE: Exception processing: 557627 org.apache.logging.log4j.core.async.RingBufferLogEvent@45c7b5da
> java.lang.InterruptedException
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(Unknown Source)
>         at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source)
>         at com.lmax.disruptor.BlockingWaitStrategy.waitFor(BlockingWaitStrategy.java:45)
>         at com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:56)
>         at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:124)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>         at java.lang.Thread.run(Unknown Source)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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