[ 
https://issues.apache.org/jira/browse/ARTEMIS-2515?focusedWorklogId=326915&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-326915
 ]

ASF GitHub Bot logged work on ARTEMIS-2515:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Oct/19 14:04
            Start Date: 11/Oct/19 14:04
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on pull request #2861: 
ARTEMIS-2515 pageIterator.hasNext spends too much time in the case of no 
messages matched
URL: https://github.com/apache/activemq-artemis/pull/2861#discussion_r334007680
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
 ##########
 @@ -2942,7 +2946,14 @@ private void depage(final boolean scheduleExpiry) {
       this.directDeliver = false;
 
       int depaged = 0;
-      while (timeout > System.currentTimeMillis() && needsDepage() && 
pageIterator.hasNext()) {
+      while (timeout > System.nanoTime() && needsDepage()) {
+         int status = pageIterator.tryNext();
+         if (status == 2) {
+            continue;
+         } else if (status == 0) {
+            break;
+         }
+
 
 Review comment:
   Same here
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 326915)
    Time Spent: 50m  (was: 40m)

> pageIterator.hasNext spends too much time in the case of no messages matched
> ----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2515
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2515
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.10.1
>            Reporter: Wei Yang
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Discussion thread hereĀ 
> [http://activemq.2283324.n4.nabble.com/DISCUSS-Artemis-pageIterator-hasNext-spends-too-much-time-in-the-case-of-no-messages-matched-td4752397.html]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to