You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/01/17 15:13:00 UTC

[jira] [Work logged] (ARTEMIS-2212) Avoid using CLQ on ServerConsumerImpl

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

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

                Author: ASF GitHub Bot
            Created on: 17/Jan/19 15:12
            Start Date: 17/Jan/19 15:12
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on pull request #2480: ARTEMIS-2212 Avoid using CLQ on ServerConsumerImpl
URL: https://github.com/apache/activemq-artemis/pull/2480#discussion_r248709539
 
 

 ##########
 File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
 ##########
 @@ -509,21 +518,16 @@ public synchronized void close(final boolean failed) throws Exception {
 
       removeItself();
 
-      LinkedList<MessageReference> refs = cancelRefs(failed, false, null);
-
-      Iterator<MessageReference> iter = refs.iterator();
+      List<MessageReference> refs = cancelRefs(failed, false, null);
 
       Transaction tx = new TransactionImpl(storageManager);
 
-      while (iter.hasNext()) {
-         MessageReference ref = iter.next();
-
+      refs.forEach(ref -> {
 
 Review comment:
   is this atomic?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

            Worklog Id:     (was: 186342)
            Time Spent: 10m
    Remaining Estimate: 0h

> Avoid using CLQ on ServerConsumerImpl
> -------------------------------------
>
>                 Key: ARTEMIS-2212
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2212
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>    Affects Versions: 2.7.0
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> ServerConsumerImpl is using a ConcurrentLinkedQueue that can be avoided to be used considering that any accesses is guarded by a lock.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)