activemq-issues mailing list archives

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

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

ASF subversion and git services commented on ARTEMIS-708:
---------------------------------------------------------

Commit 028f92ffa5258bb8c9dd7df994b2c75cbd7ecd32 in activemq-artemis's branch refs/heads/master
from bayern39
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=028f92f ]

[ARTEMIS-708] Incorrect ConcurrentHashSet.remove call in QueueImpl.DelayedAddRedistributor.run


> 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
>
> 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