You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/06/10 17:37:24 UTC

[1/4] logging-log4j2 git commit: LOG4J2-1422 verify that CountingAsyncQueueFullPolicy is correctly installed (or the BlockingAppender shutdown flag is never set)

Repository: logging-log4j2
Updated Branches:
  refs/heads/master e21f7a873 -> 58105fd61


LOG4J2-1422 verify that CountingAsyncQueueFullPolicy is correctly installed (or the BlockingAppender shutdown flag is never set)


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d8a40705
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d8a40705
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d8a40705

Branch: refs/heads/master
Commit: d8a40705091f50049a762ef0fae618e756aeda51
Parents: e21f7a8
Author: rpopma <rp...@apache.org>
Authored: Sat Jun 11 02:35:00 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Jun 11 02:35:00 2016 +0900

----------------------------------------------------------------------
 .../log4j/core/appender/AsyncAppenderQueueFullPolicyTest.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d8a40705/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderQueueFullPolicyTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderQueueFullPolicyTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderQueueFullPolicyTest.java
index b271d70..452bf72 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderQueueFullPolicyTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/AsyncAppenderQueueFullPolicyTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.logging.log4j.core.appender;
 
+import java.lang.reflect.Field;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.logging.log4j.Level;
@@ -76,6 +77,12 @@ public class AsyncAppenderQueueFullPolicyTest {
     public void testRouter() throws Exception {
         final Logger logger = LogManager.getLogger(AsyncAppenderQueueFullPolicyTest.class);
 
+        Field field = AsyncAppender.class.getDeclaredField("asyncQueueFullPolicy");
+        field.setAccessible(true);
+        Object policy = field.get(asyncAppender);
+        assertEquals("CountingAsyncQueueFullPolicy installed correctly",
+                CountingAsyncQueueFullPolicy.class, policy.getClass());
+
         assertEquals(3, asyncAppender.getQueueCapacity());
         logger.error("event 1 - gets taken off the queue");
         logger.warn("event 2");


[4/4] logging-log4j2 git commit: LOG4J2-1422 change log

Posted by rp...@apache.org.
LOG4J2-1422 change log


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/58105fd6
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/58105fd6
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/58105fd6

Branch: refs/heads/master
Commit: 58105fd6149cbc2a86d4e1faf77d6fa50c6d02ac
Parents: f783408
Author: rpopma <rp...@apache.org>
Authored: Sat Jun 11 02:37:16 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Jun 11 02:37:16 2016 +0900

----------------------------------------------------------------------
 src/changes/changes.xml | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/58105fd6/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 355f6e6..aa7a644 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
   </properties>
   <body>
     <release version="2.6.2" date="2016-MM-DD" description="GA Release 2.6.2">
+      <action issue="LOG4J2-1422" dev="rpopma" type="fix">
+        Fixed issue where AsyncAppenderQueueFullPolicyTest sometimes hangs.
+      </action>
       <action issue="LOG4J2-1415" dev="rpopma" type="add">
         (GC) ParameterFormatter now avoids calling toString() on auto-boxed primitive message parameters.
       </action>


[3/4] logging-log4j2 git commit: LOG4J2-1422 AsyncAppender$AsyncThread.shutdown() now verifies if the underlying appender is sleeping/waiting/joining/parked, and if so, interrupt()s the thread

Posted by rp...@apache.org.
LOG4J2-1422 AsyncAppender$AsyncThread.shutdown() now verifies if the underlying appender is sleeping/waiting/joining/parked, and if so, interrupt()s the thread


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/f783408e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/f783408e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/f783408e

Branch: refs/heads/master
Commit: f783408eb32d374a90ac828a25537687b4a696b3
Parents: 4f57c7e
Author: rpopma <rp...@apache.org>
Authored: Sat Jun 11 02:35:58 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Jun 11 02:35:58 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/core/appender/AsyncAppender.java     | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/f783408e/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
index 0abb07e..7a449d2 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AsyncAppender.java
@@ -349,6 +349,9 @@ public final class AsyncAppender extends AbstractAppender {
             if (queue.isEmpty()) {
                 queue.offer(SHUTDOWN);
             }
+            if (getState() == State.TIMED_WAITING || getState() == State.WAITING) {
+                this.interrupt(); // LOG4J2-1422: if underlying appender is stuck in wait/sleep/join/park call
+            }
         }
     }
 


[2/4] logging-log4j2 git commit: LOG4J2-1422 BlockingAppender.append now exits the method if it's Thread.sleep() call is interrupted

Posted by rp...@apache.org.
LOG4J2-1422 BlockingAppender.append now exits the method if it's Thread.sleep() call is interrupted


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/4f57c7e2
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4f57c7e2
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4f57c7e2

Branch: refs/heads/master
Commit: 4f57c7e2de4be9a048bda66c82d4d295334308c6
Parents: d8a4070
Author: rpopma <rp...@apache.org>
Authored: Sat Jun 11 02:35:19 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Jun 11 02:35:19 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/test/appender/BlockingAppender.java    | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4f57c7e2/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
index 4d3c7d8..179b821 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/BlockingAppender.java
@@ -43,6 +43,7 @@ public class BlockingAppender extends AbstractAppender {
             try {
                 Thread.sleep(10L);
             } catch (final InterruptedException e) {
+                running = false; // LOG4J2-1422 cooperate with signal to get us unstuck
                 Thread.currentThread().interrupt(); // set interrupt status
             }
         }