ICEpush
  1. ICEpush
  2. PUSH-190

ConcurrentModificationException on adding users to push group

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      ICEpush environment
    • Assignee Priority:
      P1

      Description

      Test with the Auction sample with the java test client. Typical test involves 30 clients joining the auction push group. During the test startup phase I generally get one or two of the following Exceptions:

      java.util.ConcurrentModificationException
          at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
          at java.util.AbstractList$Itr.next(AbstractList.java:343)
          at org.icepush.LocalNotificationBroadcaster.broadcast(LocalNotificationBroadcaster.java:100)
          at org.icepush.LocalPushGroupManager$Notification.run(LocalPushGroupManager.java:364)
          at org.icepush.LocalPushGroupManager$QueueConsumerTask.run(LocalPushGroupManager.java:448)
          at java.util.TimerThread.mainLoop(Timer.java:512)
          at java.util.TimerThread.run(Timer.java:462)
      12-Sep-2012 2:39:34 PM org.icepush.servlet.AsyncAdaptingServlet <init>

      The application runs fine after the startup phase. It's unclear whether the client actually was able to join the group or not.



      Looking at the code, the broadcast method iterates over the set of receivers

       for (Receiver receiver : receivers) {
                  receiverConfirmedMapLock.lock();
                  try {
                      if (receiverConfirmedMap.get(receiver) == ConfirmationStatus.FALSE) {
                          receiver.receive(notifiedPushIds, receiverConfirmationMap.remove(receiver));
                      }
                  } finally {
                      receiverConfirmedMapLock.unlock();
                  }
              }

      while the addReceiver method can freely add new receivers to the underlying collection:

          public void addReceiver(Receiver receiver) {
              receivers.add(receiver);
          }

        Activity

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Greg Dick
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: