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

Message getHeaders not protected from concurrent modification

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.6.4, 2.7
    • 2.6.3
    • None
    • Documentation (Ref Guide, User Guide, etc.), Release Notes
    • Low
    • Hide

      No workaround exists

      Show
      No workaround exists

      We have just downloaded the latest JGroups 2.6.3.GA version for some initial multicast testing. There is no expirience with the API on our side. The initial review of the Message class shows us huge memory requirements of each message instance. The HashMap for headers and the ReentrantReadWriteLock for headers access seems to be a bit to much overhead for messages with the data (buf) lenght of few bytes.

      Despite using the heavy RRWLock there is an unprotected read access to the headers map possible. The method getHeaders returns the headers as unmodifiableMap instead of a copy created within the read lock. An iteration over the returned unmodifiableMap might throw ConcurrentModificationException as the same headers map object might be modified using the putHeader method.

              rhn-engineering-bban Bela Ban
              frajt_jira Michal Frajt (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: