Skip to content

Instantly share code, notes, and snippets.

ublic class ClientSideLoadBalancingExample {
static int tcount = 0;
static class MyRunner extends Thread {
MyRunner() {
super("Thread " + (++tcount));
}
@Override
Java stack information for the threads listed above:
===================================================
"Thread-4895":
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007eff46968> (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:870)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1199)
at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:943)
Found one Java-level deadlock:
=============================
"Thread-0 (ActiveMQ-remoting-threads-ActiveMQServerImpl::serverUUID=f9874c4e-3299-11ea-9973-e0d55e27b7f3-1348202855)":
SUREFIRE-859: waiting to lock monitor 0x00007f4a1002a7b8 (object 0x0000000616e988f0, a org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl),
which is held by "Thread-3 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@45837207)"
"Thread-3 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@45837207)":
SUREFIRE-859: waiting for ownable synchronizer 0x0000000616ee5030, (a java.util.concurrent.locks.ReentrantLock$NonfairSync),
which is held by "Thread-2 (ActiveMQ-IO-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$7@233e20d9)"
"Thread-2 (ActiveMQ-IO-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$7@233e20d9)":
SUREFIRE-859: waiting to lock monitor 0x00007f496804c638 (object 0x0000000616ea9d38, a org.apache.
Memory report after org.apache.activemq.artemis.tests.integration.amqp.JMSWebSocketConnectionTest
|Class | Instances| Bytes|
|[B | 3769|1528800264|
|[C | 81351| 49889352|
|java.util.HashMap$Node | 57740| 1847680|
|java.lang.String | 74881| 1797144|
|[Lio.netty.buffer.PoolSubpage; | 572| 1576896|
|[Ljava.util.HashMap$Node; | 10808| 999672|
|java.util.HashMap
try
{
LargeMessageDeliverer pendingLargeMessageDeliverer = largeMessageDeliverer;
if (pendingLargeMessageDeliverer != null)
{
pendingLargeMessageDeliverer.finish();
}
}
catch (Throwable e)
{
public synchronized void cancelRedistributor() throws Exception
{
if (redistributor != null)
{
redistributor.stop();
Redistributor redistributorToRemove = redistributor;
redistributor = null;
removeConsumer(redistributorToRemove);
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
ava.lang.ArrayIndexOutOfBoundsException: 7819
at org.apache.activemq.artemis.utils.collections.ConcurrentLongHashMap$Section.get(ConcurrentLongHashMap.java:230)
at org.apache.activemq.artemis.utils.collections.ConcurrentLongHashMap.get(ConcurrentLongHashMap.java:117)
at org.apache.activemq.artemis.utils.collections.ConcurrentLongHashMap.containsKey(ConcurrentLongHashMap.java:121)
at org.apache.activemq.artemis.core.journal.impl.JournalImpl.checkKnownRecordID(JournalImpl.java:966)
at org.apache.activemq.artemis.core.journal.impl.JournalImpl.appendDeleteRecord(JournalImpl.java:867)
at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.deleteMessage(AbstractJournalStorageManager.java:419)
at org.apache.activemq.artemis.tests.integration.journal.NIOJournalCompactTest$4$1$1.run(NIOJournalCompactTest.java:1783)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
@clebertsuconic
clebertsuconic / MyTest.java
Created June 26, 2017 14:46
Test for Network Pinger
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.junit.Assert;
import org.junit.Test;
public class MyTest extends ActiveMQTestBase {
@Test
public void testNetworkPinger() throws Exception {
Configuration configuration = createBasicConfig();
configuration.setNetworkCheckPeriod(10);
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*