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 16:11:20 GMT


Sean Busbey commented on ACCUMULO-4469:

dug in.

When we stop the service [here|]:

    } finally {
      if (null != service) {

does not wait for currently executing tasks to finish. So on our last node visit, we'll get
[a TimeOutException and exit the loop|],
but that last task may still be running by the time we get to our fixture cleanup.

we should add a call to [awaitTermination|,%20java.util.concurrent.TimeUnit)]
to wait for it to finish, I think.

The fixture clean up is the only thing that can run in parallel, since the randomwalk executor
only has one thread. We should make a copy of the list, but that also might get a concurrent
modification exception (e.g. if the waitTermination timedout). It should be rare, so I think
we should just retry making a deep copy. (using CopyOnWriteArrayList would avoid the concurrent
modification exception but we might miss a table to delete if the final operation was one
of those that adds to the list.)

> 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