You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@samoa.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/19 13:37:01 UTC

[jira] [Commented] (SAMOA-71) HorizontalAMRulesRegressor fails with ConcurrentModificationException

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

ASF GitHub Bot commented on SAMOA-71:
-------------------------------------

GitHub user mgrzenda opened a pull request:

    https://github.com/apache/incubator-samoa/pull/68

    SAMOA-71: fixes concurrency issues in HorizontalAMRulesRegressor

    I suggest a change in ruleSet implementation from LinkedList (providing fail-fast iterators, which causes ConcurrencyException when list content changes during iterating over it) to CopyOnWriteArrayList (which is a thread-safe variant eliminating concurrency exceptions). In the analysed case, the modifications to ruleSet are expected to be much less frequent than reading the rules. When the number of read operations is relatively large and update operations are far less frequent, a possible choice is CopyOnWriteArrayList.
    
    I have compared the performance on 35k instance streams (with a higher than 35k number concurrency exception got thrown) and got the same <1 second processing time. Hence, the possible negative impact on the performance can be considered negligible, if any. Still, suggestions and possible other solution ideas from designers of AMRules are welcome.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mgrzenda/incubator-samoa SAMOA-71

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-samoa/pull/68.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #68
    
----
commit b2ebe028bf2fc24b9f41605d5075f6706c6e6e3d
Author: Maciej Grzenda <ma...@gmail.com>
Date:   2017-07-19T13:12:35Z

    SAMOA-71: fixes concurrency issues in HorizontalAMRulesRegressor

----


> HorizontalAMRulesRegressor fails with ConcurrentModificationException
> ---------------------------------------------------------------------
>
>                 Key: SAMOA-71
>                 URL: https://issues.apache.org/jira/browse/SAMOA-71
>             Project: SAMOA
>          Issue Type: Bug
>          Components: SAMOA-API
>            Reporter: Maciej Grzenda
>            Priority: Minor
>
> When Horizontal Adaptive Model Rules Regressor is used, AMRRuleSetProcessor that is used in turn occasionally fails with ConcurrentModificationException:
> Exception in thread "main" java.util.ConcurrentModificationException
>         at java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
>         at java.util.LinkedList$ListItr.next(Unknown Source)
>         at org.apache.samoa.learners.classifiers.rules.distributed.AMRRuleSetPro
> cessor.processInstanceEvent(AMRRuleSetProcessor.java:130)
> The reason seems to be ruleSet is not thread-safe, but this can be possibly changed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)