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 19:03:20 GMT


Sean Busbey commented on ACCUMULO-4469:

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

I reflected on this over lunch, and I think my reasoning is flawed. If we're making a deep
copy, we're just as likely to miss a final table addition as if we used CopyOnWriteArrayList
in the first place. I think the COWAL approach will be simpler, so we should do it. However,
we should add a follow on JIRA to improve this module to make use of a namespace that we just
delete at the end to account for stragglers.

> 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