You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ro...@apache.org on 2022/10/28 10:18:33 UTC

[activemq-artemis] branch main updated (9056ac1cc7 -> e4ef483115)

This is an automated email from the ASF dual-hosted git repository.

robbie pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


    from 9056ac1cc7 ARTEMIS-4074 Diagnostic involving FileRepository pushOpen not responding fast enough
     new 69264aee32 ARTEMIS-4076: make test ThreadLeakCheckRule account for differences on Java 19
     new 3a55ac72e5 ARTEMIS-4076: handle EventLoop becoming AutoClosable via ExecutorService parent on Java 19, and default method impl causing AllClassesTest to infinite loop
     new e4ef483115 ARTEMIS-4076: add a JDK 19 run to CI jobs

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/build.yml                                      | 4 ++--
 .../protocol/amqp/proton/handler/ExecutorNettyAdapter.java       | 9 +++++++--
 .../org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java   | 4 ++--
 .../org/apache/activemq/artemis/tests/unit/AllClassesTest.java   | 2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)


[activemq-artemis] 02/03: ARTEMIS-4076: handle EventLoop becoming AutoClosable via ExecutorService parent on Java 19, and default method impl causing AllClassesTest to infinite loop

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 3a55ac72e5d31ff3ce0546904e1afec5e6503675
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Thu Oct 27 11:54:49 2022 +0100

    ARTEMIS-4076: handle EventLoop becoming AutoClosable via ExecutorService parent on Java 19, and default method impl causing AllClassesTest to infinite loop
    
    Adds a timeout to the test to prevent similar future issues.
---
 .../protocol/amqp/proton/handler/ExecutorNettyAdapter.java       | 9 +++++++--
 .../org/apache/activemq/artemis/tests/unit/AllClassesTest.java   | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ExecutorNettyAdapter.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ExecutorNettyAdapter.java
index 9d0f09eb8a..31b10c209b 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ExecutorNettyAdapter.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ExecutorNettyAdapter.java
@@ -40,7 +40,7 @@ import org.apache.activemq.artemis.utils.actors.ArtemisExecutor;
  *  TODO: This could be refactored out of the main codebase but at a high cost.
  *        We may do it some day if we find an easy way that won't clutter the code too much.
  *  */
-public class ExecutorNettyAdapter implements EventLoop {
+public class ExecutorNettyAdapter implements EventLoop, AutoCloseable {
 
    final ArtemisExecutor executor;
 
@@ -187,7 +187,7 @@ public class ExecutorNettyAdapter implements EventLoop {
 
    @Override
    public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
-      return false;
+      return true;
    }
 
    @Override
@@ -218,4 +218,9 @@ public class ExecutorNettyAdapter implements EventLoop {
    public void execute(Runnable command) {
       executor.execute(command);
    }
+
+   @Override
+   public void close() {
+     // noop
+   }
 }
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java
index 7f382650d9..649c953af2 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/AllClassesTest.java
@@ -80,7 +80,7 @@ public class AllClassesTest {
    }
 
 
-   @Test
+   @Test(timeout = 3000)
    public void testToString() {
       Object targetInstance = null;
 


[activemq-artemis] 03/03: ARTEMIS-4076: add a JDK 19 run to CI jobs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit e4ef4831151f36292019c3ebb606608da630a20c
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Thu Oct 27 11:56:49 2022 +0100

    ARTEMIS-4076: add a JDK 19 run to CI jobs
---
 .github/workflows/build.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 19c9b19daa..d6681845e9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,7 +9,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        java: [ 11, 17 ]
+        java: [ 11, 17, 19 ]
 
     steps:
       - uses: actions/checkout@v3
@@ -48,7 +48,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        java: [ 11, 17 ]
+        java: [ 11, 17, 19 ]
 
     steps:
       - uses: actions/checkout@v3


[activemq-artemis] 01/03: ARTEMIS-4076: make test ThreadLeakCheckRule account for differences on Java 19

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 69264aee32795047381ae914348440d9ef385a6f
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Thu Oct 27 11:53:23 2022 +0100

    ARTEMIS-4076: make test ThreadLeakCheckRule account for differences on Java 19
    
    In Java 19 the "process reaper" Thread name can change while it is working to also denote the related pid.
    
    Also, the threads are created differently and dont belong to the "system" thread group as before, but the "InnocuousThreadGroup".
    
    Related changes:
    https://github.com/openjdk/jdk/commit/9561b5e041c4cc70319e60953819c521c1e68d6c
    https://github.com/openjdk/jdk/commit/f0282d7def8c043d95e9b86da926b7d45224c31c
---
 .../java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java
index a33dcb87ca..34df25a1a1 100644
--- a/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java
+++ b/artemis-unit-test-support/src/main/java/org/apache/activemq/artemis/utils/ThreadLeakCheckRule.java
@@ -235,7 +235,7 @@ public class ThreadLeakCheckRule extends TestWatcher {
    private boolean isExpectedThread(Thread thread) {
       final String threadName = thread.getName();
       final ThreadGroup group = thread.getThreadGroup();
-      final boolean isSystemThread = group != null && "system".equals(group.getName());
+      final boolean isSystemThread = group != null && ("system".equals(group.getName()) || "InnocuousThreadGroup".equals(group.getName()));
       final String javaVendor = System.getProperty("java.vendor");
 
       if (threadName.contains("SunPKCS11")) {
@@ -244,7 +244,7 @@ public class ThreadLeakCheckRule extends TestWatcher {
          return true;
       } else if (threadName.contains("Attach Listener")) {
          return true;
-      } else if ((javaVendor.contains("IBM") || isSystemThread) && threadName.equals("process reaper")) {
+      } else if ((javaVendor.contains("IBM") || isSystemThread) && threadName.startsWith("process reaper")) {
          return true;
       } else if ((javaVendor.contains("IBM") || isSystemThread) && threadName.equals("ClassCache Reaper")) {
          return true;