accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Busbey (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-4469) ConcurrentModificationException while running MultiTable.xml node in Random Walk
Date Fri, 23 Sep 2016 15:44:20 GMT


Sean Busbey commented on ACCUMULO-4469:

The HashMap is just of shared state. in the case of "tableList" it's sharing the ArrayList,
which is [created once|]
and modified by the various actions in the MultiTable test.

It sounds like atleast the teardown can run in parallel to the actions in the test nodes.
Making a copy here would be fine, or we could use a CopyOnWriteArrayList, or synchronize our
access to it.

> ConcurrentModificationException while running MultiTable.xml node in Random Walk 
> ---------------------------------------------------------------------------------
>                 Key: ACCUMULO-4469
>                 URL:
>             Project: Accumulo
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 1.7.2
>            Reporter: Dima Spivak
>            Assignee: Dima Spivak
> After the resolution of ACCUMULO-4467, I got back to playing with Random Walk and had
a failure caused by a {{ConcurrentModificationException}}:
> {code}
> 23 01:03:04,316 [randomwalk.Framework] ERROR: Error during random walk
> java.lang.Exception: Error running node MultiTable.xml
>         at org.apache.accumulo.test.randomwalk.Module.visit(
>         at
>         at org.apache.accumulo.test.randomwalk.Framework.main(
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>         at java.lang.reflect.Method.invoke(
>         at org.apache.accumulo.start.Main$
>         at
> Caused by: java.util.ConcurrentModificationException
>         at java.util.ArrayList$Itr.checkForComodification(
>         at java.util.ArrayList$
>         at org.apache.accumulo.test.randomwalk.multitable.MultiTableFixture.tearDown(
>         at org.apache.accumulo.test.randomwalk.Module.visit(
>         at org.apache.accumulo.test.randomwalk.Module$
>         at org.apache.accumulo.test.randomwalk.Module$
>         at
>         at java.util.concurrent.Executors$
>         at
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
>         ... 1 more
> {code}
> [This section of code|]
seems to be at fault. In particular, it looks like we're getting the table list, but then
instead of doing a deep copy to a new {{ArrayList<String>}} from which we choose tables
to delete, we're looping through and deleting tables while referring to the changing list,
which has the effect of modifying it and making Java unhappy. Am I missing something more
complex or can I fix this one myself by just doing the aforementioned deep copy of the table
list? Or is a better way to use the {{TableOperations.list()}} method and iterate through
the {{SortedSet<String>}} it provides?

This message was sent by Atlassian JIRA

View raw message