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 2018/06/06 20:14:39 UTC

[1/3] activemq-artemis git commit: ARTEMIS-1914 Fix NPE on ConfigurationImpl.hashCode() [Forced Update!]

Repository: activemq-artemis
Updated Branches:
  refs/heads/2.6.x 7580650b5 -> 9fd43a6b7 (forced update)


ARTEMIS-1914 Fix NPE on ConfigurationImpl.hashCode()

(cherry picked from commit 1d89bc7dd279b6741b7ff276f2230aaab60f0db8)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3acfee42
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3acfee42
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3acfee42

Branch: refs/heads/2.6.x
Commit: 3acfee42091812f0b962d0fc3753090c80c2a5f3
Parents: 7a1f931
Author: Andrey Arkaev <aa...@naumen.ru>
Authored: Wed Jun 6 18:08:15 2018 +0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Jun 6 16:14:29 2018 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/config/impl/ConfigurationImpl.java  | 2 +-
 .../artemis/core/config/impl/ConfigurationImplTest.java       | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3acfee42/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
index ae02dcd..ae4a25f 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java
@@ -1635,7 +1635,7 @@ public class ConfigurationImpl implements Configuration, Serializable {
       result = prime * result + (logJournalWriteRate ? 1231 : 1237);
       result = prime * result + ((managementAddress == null) ? 0 : managementAddress.hashCode());
       result = prime * result + ((managementNotificationAddress == null) ? 0 : managementNotificationAddress.hashCode());
-      result = prime * result + (maskPassword ? 1231 : 1237);
+      result = prime * result + (maskPassword == null ? 0 : maskPassword.hashCode());
       result = prime * result + maxConcurrentPageIO;
       result = prime * result + (int) (memoryMeasureInterval ^ (memoryMeasureInterval >>> 32));
       result = prime * result + memoryWarningThreshold;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3acfee42/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
index 58283b3..ca28e35 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java
@@ -89,6 +89,13 @@ public class ConfigurationImplTest extends ActiveMQTestBase {
    }
 
    @Test
+   public void testNullMaskPassword() {
+      ConfigurationImpl impl = new ConfigurationImpl();
+      impl.setMaskPassword(null);
+      impl.hashCode();
+   }
+
+   @Test
    public void testSetGetAttributes() throws Exception {
       for (int j = 0; j < 100; j++) {
          int i = RandomUtil.randomInt();


[3/3] activemq-artemis git commit: ARTEMIS-1915 Expiry Scanner is holding a lock on the queue

Posted by cl...@apache.org.
ARTEMIS-1915 Expiry Scanner is holding a lock on the queue

No tests required as there is no semantic changes here.
Current tests should validate this change.

(cherry picked from commit dfb41aed4ccdfb211a6c4529e05bef41d90046b6)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9fd43a6b
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9fd43a6b
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9fd43a6b

Branch: refs/heads/2.6.x
Commit: 9fd43a6b74876a9fc0f8d76e27bf97d284f6749a
Parents: 3acfee4
Author: Clebert Suconic <cl...@apache.org>
Authored: Mon Jun 4 22:28:29 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Jun 6 16:14:30 2018 -0400

----------------------------------------------------------------------
 .../artemis/core/server/impl/QueueImpl.java     | 96 ++++++++++----------
 1 file changed, 50 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9fd43a6b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index 94b7640..5da8dc1 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -906,7 +906,6 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
          leaveCritical(CRITICAL_CONSUMER);
       }
 
-
    }
 
    @Override
@@ -1178,22 +1177,22 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
    }
 
    @Override
-   public synchronized int getScheduledCount() {
+   public int getScheduledCount() {
       return scheduledDeliveryHandler.getScheduledCount();
    }
 
    @Override
-   public synchronized long getScheduledSize() {
+   public long getScheduledSize() {
       return scheduledDeliveryHandler.getScheduledSize();
    }
 
    @Override
-   public synchronized int getDurableScheduledCount() {
+   public int getDurableScheduledCount() {
       return scheduledDeliveryHandler.getDurableScheduledCount();
    }
 
    @Override
-   public synchronized long getDurableScheduledSize() {
+   public long getDurableScheduledSize() {
       return scheduledDeliveryHandler.getDurableScheduledSize();
    }
 
@@ -1788,6 +1787,12 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
 
       @Override
       public void run() {
+
+         boolean expired = false;
+         boolean hasElements = false;
+         int elementsExpired = 0;
+
+         LinkedList<MessageReference> expiredMessages = new LinkedList<>();
          synchronized (QueueImpl.this) {
             if (queueDestroyed) {
                return;
@@ -1796,54 +1801,24 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
 
             LinkedListIterator<MessageReference> iter = iterator();
 
-            boolean expired = false;
-            boolean hasElements = false;
-
-            int elementsExpired = 0;
             try {
-               Transaction tx = null;
-
                while (postOffice.isStarted() && iter.hasNext()) {
                   hasElements = true;
                   MessageReference ref = iter.next();
-                  try {
-                     if (ref.getMessage().isExpired()) {
-                        if (tx == null) {
-                           tx = new TransactionImpl(storageManager);
-                        }
-                        incDelivering(ref);
-                        expired = true;
-                        expire(tx, ref);
-                        iter.remove();
-                        refRemoved(ref);
-
-                        if (++elementsExpired >= MAX_DELIVERIES_IN_LOOP) {
-                           logger.debug("Breaking loop of expiring");
-                           scannerRunning.incrementAndGet();
-                           getExecutor().execute(this);
-                           break;
-                        }
+                  if (ref.getMessage().isExpired()) {
+                     incDelivering(ref);
+                     expired = true;
+                     expiredMessages.add(ref);
+                     iter.remove();
+
+                     if (++elementsExpired >= MAX_DELIVERIES_IN_LOOP) {
+                        logger.debug("Breaking loop of expiring");
+                        scannerRunning.incrementAndGet();
+                        getExecutor().execute(this);
+                        break;
                      }
-
-                  } catch (Exception e) {
-                     ActiveMQServerLogger.LOGGER.errorExpiringReferencesOnQueue(e, ref);
                   }
                }
-
-               logger.debug("Expired " + elementsExpired + " references");
-
-               try {
-                  if (tx != null) {
-                     tx.commit();
-                  }
-               } catch (Exception e) {
-                  ActiveMQServerLogger.LOGGER.unableToCommitTransaction(e);
-               }
-
-               // If empty we need to schedule depaging to make sure we would depage expired messages as well
-               if ((!hasElements || expired) && pageIterator != null && pageIterator.hasNext()) {
-                  scheduleDepage(true);
-               }
             } finally {
                try {
                   iter.close();
@@ -1854,6 +1829,35 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
 
             }
          }
+
+         if (!expiredMessages.isEmpty()) {
+            Transaction tx = new TransactionImpl(storageManager);
+            for (MessageReference ref : expiredMessages) {
+               if (tx == null) {
+                  tx = new TransactionImpl(storageManager);
+               }
+               try {
+                  expire(tx, ref);
+                  refRemoved(ref);
+               } catch (Exception e) {
+                  ActiveMQServerLogger.LOGGER.errorExpiringReferencesOnQueue(e, ref);
+               }
+            }
+
+            try {
+               tx.commit();
+            } catch (Exception e) {
+               ActiveMQServerLogger.LOGGER.unableToCommitTransaction(e);
+            }
+            logger.debug("Expired " + elementsExpired + " references");
+
+
+         }
+
+         // If empty we need to schedule depaging to make sure we would depage expired messages as well
+         if ((!hasElements || expired) && pageIterator != null && pageIterator.hasNext()) {
+            scheduleDepage(true);
+         }
       }
    }
 


[2/3] activemq-artemis git commit: ARTEMIS-1913 Dependency to netty tcpnative should be optional

Posted by cl...@apache.org.
ARTEMIS-1913 Dependency to netty tcpnative should be optional

(cherry picked from commit b6fba64d9ed843160a2f45e2631737ff15e6d40f)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/7a1f9311
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/7a1f9311
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/7a1f9311

Branch: refs/heads/2.6.x
Commit: 7a1f9311efcf3067ea78cd83aaf246cddd096d1d
Parents: 0b460ea
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Jun 6 12:57:45 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Jun 6 16:14:29 2018 -0400

----------------------------------------------------------------------
 artemis-core-client/pom.xml                      | 5 -----
 examples/features/standard/netty-openssl/pom.xml | 8 ++++++++
 pom.xml                                          | 7 -------
 tests/integration-tests/pom.xml                  | 6 ++++++
 tests/unit-tests/pom.xml                         | 6 ++++++
 5 files changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7a1f9311/artemis-core-client/pom.xml
----------------------------------------------------------------------
diff --git a/artemis-core-client/pom.xml b/artemis-core-client/pom.xml
index 092b8c3..47b72e2 100644
--- a/artemis-core-client/pom.xml
+++ b/artemis-core-client/pom.xml
@@ -118,11 +118,6 @@
          <groupId>io.netty</groupId>
          <artifactId>netty-common</artifactId>
       </dependency>
-      <dependency>
-         <groupId>io.netty</groupId>
-         <artifactId>netty-tcnative-boringssl-static</artifactId>
-      </dependency>
-
    </dependencies>
 
    <profiles>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7a1f9311/examples/features/standard/netty-openssl/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/standard/netty-openssl/pom.xml b/examples/features/standard/netty-openssl/pom.xml
index 5f61a20..b146d28 100644
--- a/examples/features/standard/netty-openssl/pom.xml
+++ b/examples/features/standard/netty-openssl/pom.xml
@@ -33,6 +33,7 @@ under the License.
 
    <properties>
       <activemq.basedir>${project.basedir}/../../../..</activemq.basedir>
+      <netty.tcnative.version>2.0.7.Final</netty.tcnative.version>
    </properties>
 
    <dependencies>
@@ -41,6 +42,12 @@ under the License.
          <artifactId>artemis-jms-client-all</artifactId>
          <version>${project.version}</version>
       </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-tcnative-boringssl-static</artifactId>
+         <version>${netty.tcnative.version}</version>
+         <!-- License: Apache 2.0 -->
+      </dependency>
    </dependencies>
 
    <build>
@@ -56,6 +63,7 @@ under the License.
                   </goals>
                   <configuration>
                      <ignore>${noServer}</ignore>
+                     <libList>io.netty:netty-tcnative-boringssl-static:${netty.tcnative.version}</libList>
                   </configuration>
                </execution>
                <execution>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7a1f9311/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8c50610..7249c2d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,6 @@
       <maven.assembly.plugin.version>2.4</maven.assembly.plugin.version>
       <mockito.version>2.8.47</mockito.version>
       <netty.version>4.1.24.Final</netty.version>
-      <netty.tcnative.version>2.0.7.Final</netty.tcnative.version>
       <proton.version>0.27.1</proton.version>
       <resteasy.version>3.0.19.Final</resteasy.version>
       <slf4j.version>1.7.21</slf4j.version>
@@ -542,12 +541,6 @@
             <!-- License: Apache 2.0 -->
          </dependency>
          <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-tcnative-boringssl-static</artifactId>
-            <version>${netty.tcnative.version}</version>
-            <!-- License: Apache 2.0 -->
-         </dependency>
-         <dependency>
             <groupId>org.apache.qpid</groupId>
             <artifactId>proton-j</artifactId>
             <version>${proton.version}</version>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7a1f9311/tests/integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/integration-tests/pom.xml b/tests/integration-tests/pom.xml
index d1c2b33..ad27864 100644
--- a/tests/integration-tests/pom.xml
+++ b/tests/integration-tests/pom.xml
@@ -397,6 +397,12 @@
          <artifactId>jgroups</artifactId>
       </dependency>
 
+      <!-- openSSL test -->
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-tcnative-boringssl-static</artifactId>
+         <version>2.0.7.Final</version>
+      </dependency>
    </dependencies>
 
    <build>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7a1f9311/tests/unit-tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/unit-tests/pom.xml b/tests/unit-tests/pom.xml
index 5748163..3f00b6e 100644
--- a/tests/unit-tests/pom.xml
+++ b/tests/unit-tests/pom.xml
@@ -160,6 +160,12 @@
          <version>2.7.0-SNAPSHOT</version>
          <scope>test</scope>
       </dependency>
+      <dependency>
+         <groupId>io.netty</groupId>
+         <artifactId>netty-tcnative-boringssl-static</artifactId>
+         <version>2.0.7.Final</version>
+         <scope>test</scope>
+      </dependency>
 
    </dependencies>