Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4469

ConcurrentModificationException while running MultiTable.xml node in Random Walk

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.2
    • Fix Version/s: 1.7.3, 1.8.1, 2.0.0
    • Component/s: test
    • Labels:
      None

      Description

      After the resolution of ACCUMULO-4467, I got back to playing with Random Walk and had a failure caused by a ConcurrentModificationException:

      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(Module.java:346)
              at org.apache.accumulo.test.randomwalk.Framework.run(Framework.java:59)
              at org.apache.accumulo.test.randomwalk.Framework.main(Framework.java:119)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.accumulo.start.Main$2.run(Main.java:157)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.util.ConcurrentModificationException
              at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
              at java.util.ArrayList$Itr.next(ArrayList.java:831)
              at org.apache.accumulo.test.randomwalk.multitable.MultiTableFixture.tearDown(MultiTableFixture.java:64)
              at org.apache.accumulo.test.randomwalk.Module.visit(Module.java:365)
              at org.apache.accumulo.test.randomwalk.Module$1.call(Module.java:283)
              at org.apache.accumulo.test.randomwalk.Module$1.call(Module.java:278)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
              at java.util.concurrent.FutureTask.run(FutureTask.java:262)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at org.apache.accumulo.fate.util.LoggingRunnable.run(LoggingRunnable.java:35)
              ... 1 more
      

      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?

        Attachments

        1. ACCUMULO-4469_1.7_v1.patch
          7 kB
          Dima Spivak

          Activity

            People

            • Assignee:
              dimaspivak Dima Spivak
              Reporter:
              dimaspivak Dima Spivak
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h