Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-7088

Possible ConcurrentModificationException while client queue image is copied

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.10.0, 1.11.0
    • client queues
    • None

    Description

      The following corner case scenario will result in a ConcurrentModificationException which causes the queue image transfer to fail and subsequently client registration to fail:

      1. Client 1 is currently opening a subscription endpoint with server 1 and events are being staged in the client's temporary registration queue
      2. One or more of those events also match interest for Client 2 who is already fully registered, so the event is put into Client 2's queue (in addition to Client 1's temp queue)
      3. Client 2 asks server 2 to open a secondary subscription endpoint.  Server 2 attempts to copy Client 2's queue from server 1. This results in serializing all of the events in Client 2's queue.
      4. While the image is being transferred, Client 1 finishes registration and begins to drain its temporary registration queue.  The filter info for each event is recalculated which ends up mutating the shared event in Client 2's queue.
      5. The event has some metadata stored as a non-concurrent set.  Recalculating the filter info for Client 1 will mutate that set, but the image transfer for Client 2 is trying to copy that set simultaneously.  This can result in a ConcurrentModificationException because the set is not thread safe.  Note that there no danger in recalculating the filter from Client 2's perspective, because it is already in Client 2's queue.  As such, Client 2's queue transfer should be tolerant of such modifications since they have no consequence to it.

      Attachments

        Activity

          People

            rmcmahon Ryan McMahon
            rmcmahon Ryan McMahon
            Votes:
            0 Vote for this issue
            Watchers:
            2 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 - 1h 50m
                1h 50m