You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org> on 2010/06/09 13:41:14 UTC
[jira] Created: (SYNAPSE-661) ConcurrentModifucationException at
StatisticsRecord
ConcurrentModifucationException at StatisticsRecord
---------------------------------------------------
Key: SYNAPSE-661
URL: https://issues.apache.org/jira/browse/SYNAPSE-661
Project: Synapse
Issue Type: Bug
Affects Versions: 1.2
Reporter: Hiranya Jayathilaka
Assignee: indika priyantha kumara
Fix For: 2.0
When running load tests (concurrency level > 15) with statistics enabled, every now and then, I get the following exception:
Exception in thread "Thread-20" java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at org.apache.synapse.aspects.statistics.StatisticsRecord.getAllLogIds(StatisticsRecord.java:90)
at org.apache.synapse.aspects.statistics.view.SystemViewStrategy.determineView(SystemViewStrategy.java:61)
Here I also have some custom code which tries to get the latest stats from Synapse periodically. When the custom code tries to access a StatisticsRecord, if it also gets updated, the above error is thrown. I think we should use a more thread safe data structure in the StatisticsRecord class, instead of an ArrayList.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-661) ConcurrentModifucationException at
StatisticsRecord
Posted by "indika priyantha kumara (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912431#action_12912431 ]
indika priyantha kumara commented on SYNAPSE-661:
-------------------------------------------------
Hiranya,
I used an ArrayList because I had prevented the conflicting operations (i.e add , get , remove) of the array list. Stats collection should not interfere with the stat viewing. Therefore, only after the stats are collected for a message, the collected stat record is put in the Statisticscollector.java where others pull from them to view. It is wrong to try to view a stat record prior to the stats collecting has finished, as it would lead to incorrect stats. So, the use of a tread safe collection instead of arraylist is not the solution(For me). Solution should be to make sure that stats are viewed only after the collection is done (i.e to avoid conflicting operations).
On the other hand, the issue you have got, I had seen with some time back...However, After I did some fixes, I was unable to reproduce that.
Do you have any thread dump? It may reveal if the conflicting operations have occurred.
Could you do the solution you think correct? I will look at later when I have a free time. I am sorry.
Thanks
Indika
> ConcurrentModifucationException at StatisticsRecord
> ---------------------------------------------------
>
> Key: SYNAPSE-661
> URL: https://issues.apache.org/jira/browse/SYNAPSE-661
> Project: Synapse
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2
> Reporter: Hiranya Jayathilaka
> Assignee: indika priyantha kumara
> Priority: Critical
> Fix For: 2.0
>
>
> When running load tests (concurrency level > 15) with statistics enabled, every now and then, I get the following exception:
> Exception in thread "Thread-20" java.util.ConcurrentModificationException
> at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
> at java.util.AbstractList$Itr.next(AbstractList.java:343)
> at org.apache.synapse.aspects.statistics.StatisticsRecord.getAllLogIds(StatisticsRecord.java:90)
> at org.apache.synapse.aspects.statistics.view.SystemViewStrategy.determineView(SystemViewStrategy.java:61)
> Here I also have some custom code which tries to get the latest stats from Synapse periodically. When the custom code tries to access a StatisticsRecord, if it also gets updated, the above error is thrown. I think we should use a more thread safe data structure in the StatisticsRecord class, instead of an ArrayList.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Updated: (SYNAPSE-661) ConcurrentModifucationException at
StatisticsRecord
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hiranya Jayathilaka updated SYNAPSE-661:
----------------------------------------
Priority: Critical (was: Major)
Component/s: Core
Indika,
Can you please provide some feedback on this?
> ConcurrentModifucationException at StatisticsRecord
> ---------------------------------------------------
>
> Key: SYNAPSE-661
> URL: https://issues.apache.org/jira/browse/SYNAPSE-661
> Project: Synapse
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2
> Reporter: Hiranya Jayathilaka
> Assignee: indika priyantha kumara
> Priority: Critical
> Fix For: 2.0
>
>
> When running load tests (concurrency level > 15) with statistics enabled, every now and then, I get the following exception:
> Exception in thread "Thread-20" java.util.ConcurrentModificationException
> at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
> at java.util.AbstractList$Itr.next(AbstractList.java:343)
> at org.apache.synapse.aspects.statistics.StatisticsRecord.getAllLogIds(StatisticsRecord.java:90)
> at org.apache.synapse.aspects.statistics.view.SystemViewStrategy.determineView(SystemViewStrategy.java:61)
> Here I also have some custom code which tries to get the latest stats from Synapse periodically. When the custom code tries to access a StatisticsRecord, if it also gets updated, the above error is thrown. I think we should use a more thread safe data structure in the StatisticsRecord class, instead of an ArrayList.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
[jira] Commented: (SYNAPSE-661) ConcurrentModifucationException at
StatisticsRecord
Posted by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SYNAPSE-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877053#action_12877053 ]
Hiranya Jayathilaka commented on SYNAPSE-661:
---------------------------------------------
How about using a ConcurrentLinkedQueue instead of ArrayList?
> ConcurrentModifucationException at StatisticsRecord
> ---------------------------------------------------
>
> Key: SYNAPSE-661
> URL: https://issues.apache.org/jira/browse/SYNAPSE-661
> Project: Synapse
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: Hiranya Jayathilaka
> Assignee: indika priyantha kumara
> Fix For: 2.0
>
>
> When running load tests (concurrency level > 15) with statistics enabled, every now and then, I get the following exception:
> Exception in thread "Thread-20" java.util.ConcurrentModificationException
> at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
> at java.util.AbstractList$Itr.next(AbstractList.java:343)
> at org.apache.synapse.aspects.statistics.StatisticsRecord.getAllLogIds(StatisticsRecord.java:90)
> at org.apache.synapse.aspects.statistics.view.SystemViewStrategy.determineView(SystemViewStrategy.java:61)
> Here I also have some custom code which tries to get the latest stats from Synapse periodically. When the custom code tries to access a StatisticsRecord, if it also gets updated, the above error is thrown. I think we should use a more thread safe data structure in the StatisticsRecord class, instead of an ArrayList.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org