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 2019/02/05 20:57:53 UTC

[activemq-artemis] branch 2.6.x updated (2d96429 -> 2a8b299)

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

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


    from 2d96429  ARTEMIS-2242 Reverting regression caused by ARTEMIS-2229
     new 4111707  ARTEMIS-2244 checkDepage method placed outside CRITICAL_DELIVER avoid critical analyzer timeout
     new 2a8b299  ARTEMIS-2244 Adding critical check around checkDepage

The 2 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:
 .../artemis/core/server/impl/QueueImpl.java        | 26 ++++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)


[activemq-artemis] 02/02: ARTEMIS-2244 Adding critical check around checkDepage

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

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

commit 2a8b29995ff5a54d1caa54cc2e82239d21aecbd3
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue Feb 5 15:15:10 2019 -0500

    ARTEMIS-2244 Adding critical check around checkDepage
    
    (cherry picked from commit e09ffe14f488efd1013005da9ecc588466dc2905)
---
 .../apache/activemq/artemis/core/server/impl/QueueImpl.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

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 ffc179b..76cb44f 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
@@ -106,11 +106,12 @@ import org.jboss.logging.Logger;
  */
 public class QueueImpl extends CriticalComponentImpl implements Queue {
 
-   protected static final int CRITICAL_PATHS = 4;
+   protected static final int CRITICAL_PATHS = 5;
    protected static final int CRITICAL_PATH_ADD_TAIL = 0;
    protected static final int CRITICAL_PATH_ADD_HEAD = 1;
    protected static final int CRITICAL_DELIVER = 2;
    protected static final int CRITICAL_CONSUMER = 3;
+   protected static final int CRITICAL_CHECK_DEPAGE = 4;
 
    private static final Logger logger = Logger.getLogger(QueueImpl.class);
 
@@ -3214,7 +3215,12 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
             }
 
             if (needCheckDepage) {
-               checkDepage();
+               enterCritical(CRITICAL_CHECK_DEPAGE);
+               try {
+                  checkDepage();
+               } finally {
+                  leaveCritical(CRITICAL_CHECK_DEPAGE);
+               }
             }
 
          } catch (Exception e) {


[activemq-artemis] 01/02: ARTEMIS-2244 checkDepage method placed outside CRITICAL_DELIVER avoid critical analyzer timeout

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

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

commit 4111707c268189ed8d7c96275bc366e207492dee
Author: yb <17...@cn.suning.com>
AuthorDate: Thu Jan 31 17:20:06 2019 +0800

    ARTEMIS-2244 checkDepage method placed outside CRITICAL_DELIVER avoid critical analyzer timeout
    
    (cherry picked from commit 8799615a136946c39bb49bd4069cff2df0035997)
---
 .../activemq/artemis/core/server/impl/QueueImpl.java   | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

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 c80d4f3..ffc179b 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
@@ -2215,7 +2215,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
     * This method will deliver as many messages as possible until all consumers are busy or there
     * are no more matching or available messages.
     */
-   private void deliver() {
+   private boolean deliver() {
       if (logger.isDebugEnabled()) {
          logger.debug(this + " doing deliver. messageReferences=" + messageReferences.size());
       }
@@ -2240,7 +2240,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
 
             deliverAsync();
 
-            return;
+            return false;
          }
 
          if (System.currentTimeMillis() > timeout) {
@@ -2250,7 +2250,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
 
             deliverAsync();
 
-            return;
+            return false;
          }
 
          MessageReference ref;
@@ -2261,7 +2261,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
 
             // Need to do these checks inside the synchronized
             if (paused || consumerList.isEmpty()) {
-               return;
+               return false;
             }
 
             if (messageReferences.size() == 0) {
@@ -2405,7 +2405,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
          }
       }
 
-      checkDepage();
+      return true;
    }
 
    private void checkDepage() {
@@ -3204,13 +3204,19 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
             // We will be using the deliverRunner instance as the guard object to avoid multiple threads executing
             // an asynchronous delivery
             enterCritical(CRITICAL_DELIVER);
+            boolean needCheckDepage = false;
             try {
                synchronized (QueueImpl.this.deliverRunner) {
-                  deliver();
+                  needCheckDepage = deliver();
                }
             } finally {
                leaveCritical(CRITICAL_DELIVER);
             }
+
+            if (needCheckDepage) {
+               checkDepage();
+            }
+
          } catch (Exception e) {
             ActiveMQServerLogger.LOGGER.errorDelivering(e);
          } finally {