Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1916

ConcurrentModificationException in FD_ALL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.6.3
    • 3.6.2
    • None

      When DEBUG logging is enabled, FD_ALL logs the set of suspected members without proper synchronization. If another thread modifies the suspected_mbrs set at the same time, it can cause a ConcurrentModificationException and the SUSPECT event will be lost.

      java.util.ConcurrentModificationException
          at java.util.HashMap$HashIterator.nextEntry(HashMap.java:922)
          at java.util.HashMap$KeyIterator.next(HashMap.java:956)
          at java.util.AbstractCollection.toString(AbstractCollection.java:457)
          at java.lang.String.valueOf(String.java:2847)
          at java.lang.StringBuilder.append(StringBuilder.java:128)
          at org.jgroups.protocols.FD_ALL.suspect(FD_ALL.java:368)
          at org.jgroups.protocols.FD_ALL$TimeoutChecker.run(FD_ALL.java:444)
          at org.jgroups.util.TimeScheduler3$Task.run(TimeScheduler3.java:287)
          at org.jgroups.util.TimeScheduler3$RecurringTask.run(TimeScheduler3.java:321)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)
      

      I would also suggest adding a synchronized block in getSuspectedMembers(), init() and stop().

      FD_ALL2 seems to have the same problem.

              rhn-engineering-bban Bela Ban
              dberinde@redhat.com Dan Berindei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: