activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARTEMIS-708) Incorrect ConcurrentHashSet.remove call in QueueImpl.DelayedAddRedistributor.run
Date Wed, 19 Oct 2016 20:53:58 GMT

    [ https://issues.apache.org/jira/browse/ARTEMIS-708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15589829#comment-15589829
] 

ASF GitHub Bot commented on ARTEMIS-708:
----------------------------------------

Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/851
  
    @bayern39 I have added a commit on top of yours.. take a look please?


> Incorrect ConcurrentHashSet.remove call in QueueImpl.DelayedAddRedistributor.run
> --------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-708
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-708
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 1.4.0
>            Reporter: Martin Styk
>             Fix For: 1.5.0
>
>
> There is a incorect {{remove}} method call on {{ConcurrentHashSet}} object in inner class
{{QueueImpl.DelayedAddRedistributor}}. 
> [Check this line on github | https://github.com/apache/activemq-artemis/blob/master/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java#L2728]
> Following is problematic part of code. 
> {code:java}
> public class QueueImpl implements Queue {
>   private final Set<ScheduledFuture<?>> futures = new ConcurrentHashSet<>();
>   private class DelayedAddRedistributor implements Runnable {
>         @Override
>         public void run() {
>             .....
>             futures.remove(this); 
>             ..... 
>        }
>    }
> }
> {code}
> {{futures}} is ConcurrentHashSet of ScheduledFuture<?>. However, QueueImpl.DelayedAddRedistributor.run()
calls {{futures.remove(this)}}, where {{this}} is an instance of {{QueueImpl.DelayedAddRedistributor}}
class. It is not ScheduledFuture<?>.  remove method never removes instance of  {{QueueImpl.DelayedAddRedistributor}}
class, since it stores Scheduled Futures.
> QueueImpl$DelayedAddRedistributor is incompatible with expected argument type java.util.concurrent.ScheduledFuture<?>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message