logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1478040 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigHelper.java src/changes/changes.xml
Date Wed, 01 May 2013 15:00:31 GMT
Author: rpopma
Date: Wed May  1 15:00:31 2013
New Revision: 1478040

URL: http://svn.apache.org/r1478040
Log:
prevent NPE in ShutdownHook thread if disruptor was already shut down; added credit to Steven
Yang for pointing out the original issue

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigHelper.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java?rev=1478040&r1=1478039&r2=1478040&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
Wed May  1 15:00:31 2013
@@ -24,8 +24,6 @@ import org.apache.logging.log4j.LogManag
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.LoggerContext.Status;
 import org.apache.logging.log4j.core.config.AppenderRef;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.LoggerConfig;

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigHelper.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigHelper.java?rev=1478040&r1=1478039&r2=1478040&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigHelper.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigHelper.java
Wed May  1 15:00:31 2013
@@ -220,6 +220,9 @@ class AsyncLoggerConfigHelper {
             return;
         }
         Disruptor<Log4jEventWrapper> temp = disruptor;
+        if (temp == null) {
+            return; // disruptor was already shut down by another thread
+        }
 
         // Must guarantee that publishing to the RingBuffer has stopped
         // before we call disruptor.shutdown()

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1478040&r1=1478039&r2=1478040&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Wed May  1 15:00:31 2013
@@ -23,7 +23,7 @@
 
   <body>
     <release version="2.0-beta6" date="@TBD@" description="Bug fixes and enhancements">
-      <action issue="LOG4J2-222" dev="rgoers" type="fix">
+      <action issue="LOG4J2-222" dev="rgoers" type="fix" due-to="Steven Yang">
         Disruptor will now shutdown during Tomcat shutdown.
       </action>
       <action dev="rpopma" type="update">



Mime
View raw message