You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2024/04/18 19:11:30 UTC

(activemq-artemis) 03/03: local debug

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

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

commit 6bc909dc7a7a9e152d1f46473f13b5d0bf4b651e
Author: Clebert Suconic <cl...@gmail.com>
AuthorDate: Thu Apr 18 15:11:07 2024 -0700

    local debug
---
 .../core/protocol/openwire/OpenWireProtocolManager.java      |  1 -
 .../artemis/core/remoting/impl/netty/NettyAcceptor.java      |  4 ++++
 .../core/remoting/server/impl/RemotingServiceImpl.java       |  1 +
 .../apache/activemq/artemis/tests/leak/ClientExitTest.java   | 12 ++++++++++--
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
index babf8e330f..f790fafca0 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireProtocolManager.java
@@ -651,7 +651,6 @@ public class OpenWireProtocolManager  extends AbstractProtocolManager<Command, O
    }
 
    public void setMaxInactivityDuration(long maxInactivityDuration) {
-      new Exception("maxInactivityDuration=" + maxInactivityDuration).printStackTrace();
       this.maxInactivityDuration = maxInactivityDuration;
    }
 
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
index 1b5fe8adcd..6116b2d75e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
@@ -970,8 +970,12 @@ public class NettyAcceptor extends AbstractAcceptor {
 
       @Override
       public void connectionDestroyed(final Object connectionID, boolean failed) {
+         new Exception("connection destroyed " + connectionID).printStackTrace();
          if (connections.remove(connectionID) != null) {
+            new Exception("Could not find " + connectionID).printStackTrace();
             listener.connectionDestroyed(connectionID, failed);
+         } else {
+            new Exception("Removed ok " + connectionID).printStackTrace();
          }
       }
 
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
index bf29b79c68..e345bd29af 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/server/impl/RemotingServiceImpl.java
@@ -486,6 +486,7 @@ public class RemotingServiceImpl implements RemotingService, ServerConnectionLif
    @Override
    public RemotingConnection removeConnection(final Object remotingConnectionID) {
       ConnectionEntry entry = connections.remove(remotingConnectionID);
+      new Exception("Removing").printStackTrace();
 
       if (entry != null) {
          if (AuditLogger.isResourceLoggingEnabled()) {
diff --git a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/ClientExitTest.java b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/ClientExitTest.java
index b5b3755915..441cbe3200 100644
--- a/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/ClientExitTest.java
+++ b/tests/leak-tests/src/test/java/org/apache/activemq/artemis/tests/leak/ClientExitTest.java
@@ -120,12 +120,17 @@ public class ClientExitTest extends AbstractLeakTest {
       doDropConnections("OPENWIRE");
    }
 
+   @Test
+   public void testDropConnectionsAMQP() throws Exception {
+      doDropConnections("AMQP");
+   }
+
    private void doDropConnections(String protocol) throws Exception {
 
       TcpProxy proxy = new TcpProxy("localhost", 61616, 60000, false);
       proxy.startProxy();
       runAfter(proxy::stopProxy);
-      int numberOfConnections = 200;
+      int numberOfConnections = 1;
 
       Process process = SpawnedVMSupport.spawnVM(ClientExitTest.class.getName(), protocol, String.valueOf(numberOfConnections));
       runAfter(process::destroyForcibly);
@@ -136,6 +141,8 @@ public class ClientExitTest extends AbstractLeakTest {
 
       Wait.assertEquals(0, () -> server.getRemotingService().getConnections().size(), 60_000);
 
+      System.out.println("Connections::" +  server.getRemotingService().getConnections().size());
+
       basicMemoryAsserts();
    }
 
@@ -190,7 +197,8 @@ public class ClientExitTest extends AbstractLeakTest {
 
          while (true) { // stays up forever until the caller halts it
             Thread.sleep(10_000);
-            Runtime.getRuntime().halt(1);
+            System.exit(-1);
+            //Runtime.getRuntime().halt(1);
          }
       } catch (Throwable e) {
          e.printStackTrace();