[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-05 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

GitHub user jbertram opened a pull request:

https://github.com/apache/activemq-artemis/pull/2347

ARTEMIS-2111 ManagementContext can leak



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-2111

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/activemq-artemis/pull/2347.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2347


commit cbc4acdbc94692b570ad5a592aecacf6ae24a52c
Author: Justin Bertram 
Date:   2018-10-05T18:39:07Z

ARTEMIS-2111 ManagementContext can leak




> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>Locked ownable synchronizers:
>   - None
> "RMI Reaper" #16 prio=5 os_prio=31 tid=0x7fe60d001800 nid=0x7703 in 
> Object.wait() [0x76322000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x00074

[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-05 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

Github user jbertram commented on the issue:

https://github.com/apache/activemq-artemis/pull/2347
  
I couldn't find a way to write a test for this so I tested manually using 
the `forceFailover()` management method on the `ActiveMQServerControl`.  If 
anybody has any clever ideas I'd love to hear them.


> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>Locked ownable synchronizers:
>   - None
> "RMI Reaper" #16 prio=5 os_prio=31 tid=0x7fe60d001800 nid=0x7703 in 
> Object.wait() [0x76322000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
>   at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:351)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:

[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-05 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

Github user franz1981 commented on the issue:

https://github.com/apache/activemq-artemis/pull/2347
  
You can take a weak reference of the ManagementContext instance you want to 
test the leak, force a GC + run finalizer (we have a method in the test suite 
for that) and then verify that the instance is being GCed..TBH it doesn't worth 
the effort ^^


> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>Locked ownable synchronizers:
>   - None
> "RMI Reaper" #16 prio=5 os_prio=31 tid=0x7fe60d001800 nid=0x7703 in 
> Object.wait() [0x76322000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
>   at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:351)
>   at java.lang.Thread.run(Thr

[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-05 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

Github user jbertram commented on the issue:

https://github.com/apache/activemq-artemis/pull/2347
  
@franz1981, thanks for the suggestion, but I don't think this is *that* 
kind of leak.  I came up with a way to test it and updated the PR.


> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>Locked ownable synchronizers:
>   - None
> "RMI Reaper" #16 prio=5 os_prio=31 tid=0x7fe60d001800 nid=0x7703 in 
> Object.wait() [0x76322000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
>   at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:351)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI TCP Accept-0" #15 daemon prio=5 os_prio=3

[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-10 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

Github user asfgit closed the pull request at:

https://github.com/apache/activemq-artemis/pull/2347


> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>Locked ownable synchronizers:
>   - None
> "RMI Reaper" #16 prio=5 os_prio=31 tid=0x7fe60d001800 nid=0x7703 in 
> Object.wait() [0x76322000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
>   at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:351)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI TCP Accept-0" #15 daemon prio=5 os_prio=31 tid=0x7fe60a902000 
> nid=0x7503 runnable [0x7621f000]
>java.lang.Thread.State: RUNNABLE
>   at java.net.PlainSocketImpl.so

[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

Github user michalxo commented on a diff in the pull request:

https://github.com/apache/activemq-artemis/pull/2347#discussion_r225120812
  
--- Diff: 
artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java ---
@@ -233,6 +237,21 @@ public void testWebConfig() throws Exception {
   assertEquals("password2", trustPass);
}
 
+   @Test
+   public void testStopManagementContext() throws Exception {
+  Run.setEmbedded(true);
+  File instance1 = new File(temporaryFolder.getRoot(), 
"instance_user");
+  System.setProperty("java.security.auth.login.config", 
instance1.getAbsolutePath() + "/etc/login.config");
+  Artemis.main("create", instance1.getAbsolutePath(), "--silent", 
"--no-autotune", "--no-web", "--no-amqp-acceptor", "--no-mqtt-acceptor", 
"--no-stomp-acceptor", "--no-hornetq-acceptor");
--- End diff --

Can we enhance this test (better to copy this one) and use by default web 
console as well?
Else Artemis process hangs as well.


> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$La

[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

Github user michalxo commented on the issue:

https://github.com/apache/activemq-artemis/pull/2347
  
I have managed to reproduced this issue on VM by simply adding extra hdd, 
formatting it, and making Artemis to use it for bindings, journal, (etc..). 
Started broker, waited for all components to go up and simply deleted hdd from 
virt-manager. 


> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>Locked ownable synchronizers:
>   - None
> "RMI Reaper" #16 prio=5 os_prio=31 tid=0x7fe60d001800 nid=0x7703 in 
> Object.wait() [0x76322000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
>   at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:351)
>   at java.lang.Thread.run(Thread.j

[jira] [Commented] (ARTEMIS-2111) ManagementContext can leak

2018-10-15 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on ARTEMIS-2111:
-

Github user jbertram commented on the issue:

https://github.com/apache/activemq-artemis/pull/2347
  
@michalxo, in your test is it the management context that's leaking or 
something else?


> ManagementContext can leak
> --
>
> Key: ARTEMIS-2111
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2111
> Project: ActiveMQ Artemis
>  Issue Type: Bug
>Affects Versions: 2.6.3
>Reporter: Justin Bertram
>Assignee: Justin Bertram
>Priority: Major
>
> If a {{management-context}} {{connector}} is configured in {{management.xml}} 
> (e.g. below) and 
> {{org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl#stop(boolean,
>  boolean, boolean)}} is called (e.g. due to criticalIOErrors) the JVM will 
> not exit due to a handful of leaked RMI related threads for the MBean server 
> implementation.
> {code:xml}
> http://activemq.org/schema";>
>
>...
> 
> {code}
> Here's an example thread dump after the broker has stopped:
> {noformat}
> 2018-08-10 10:47:59
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode):
> "Attach Listener" #122 daemon prio=9 os_prio=31 tid=0x7fe609a37800 
> nid=0x920f waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "DestroyJavaVM" #57 prio=5 os_prio=31 tid=0x7fe60a000800 nid=0x1c03 
> waiting on condition [0x]
>java.lang.Thread.State: RUNNABLE
>Locked ownable synchronizers:
>   - None
> "RMI RenewClean-[192.168.1.125:62416]" #20 daemon prio=5 os_prio=31 
> tid=0x7fe609432800 nid=0x7f03 in Object.wait() [0x7672e000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007400d1e18> (a java.lang.ref.ReferenceQueue$Lock)
>   at 
> sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:536)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI Scheduler(0)" #19 daemon prio=5 os_prio=31 tid=0x7fe60c2c4000 
> nid=0x7d03 waiting on condition [0x7662b000]
>java.lang.Thread.State: TIMED_WAITING (parking)
>   at sun.misc.Unsafe.park(Native Method)
>   - parking to wait for  <0x00074017e5b8> (a 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
>   at 
> java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
>   at 
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
>   at 
> java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
>   at 
> java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "GC Daemon" #17 daemon prio=2 os_prio=31 tid=0x7fe60c2bb000 nid=0x7903 in 
> Object.wait() [0x76425000]
>java.lang.Thread.State: TIMED_WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>   at sun.misc.GC$Daemon.run(GC.java:117)
>   - locked <0x0007402b00c8> (a sun.misc.GC$LatencyLock)
>Locked ownable synchronizers:
>   - None
> "RMI Reaper" #16 prio=5 os_prio=31 tid=0x7fe60d001800 nid=0x7703 in 
> Object.wait() [0x76322000]
>java.lang.Thread.State: WAITING (on object monitor)
>   at java.lang.Object.wait(Native Method)
>   - waiting on <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
>   - locked <0x0007401d9310> (a java.lang.ref.ReferenceQueue$Lock)
>   at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
>   at sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:351)
>   at java.lang.Thread.run(Thread.java:745)
>Locked ownable synchronizers:
>   - None
> "RMI TCP Accept-0" #15 daemon prio=5 os_prio=31 tid=0x7fe60a902000 
> nid=0x7503 runnable [0x0