Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10852

NetgroupCache is not thread-safe

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0, 2.4.1
    • Fix Version/s: 2.7.0
    • Component/s: security
    • Labels:
      None
    • Target Version/s:

      Description

      NetgroupCache internally uses two ConcurrentHashMaps and a boolean variable to signal updates on one of the ConcurrentHashMap
      None of the functions are synchronized and hence is possible to have unexpected results due to race condition between different threads.

      As an example, consider the following sequence:

      Thread1 :
      add a group
      netgroupToUsersMap is updated.
      netgroupToUsersMapUpdated is set to true.
      Thread 2:
      calls getNetgroups for a user
      Due to re-ordering, netgroupToUsersMapUpdated=true is visible, but updates in netgroupToUsersMap is not visible.
      Does a wrong update with older netgroupToUsersMap values.

        Attachments

        1. HADOOP-10852.patch
          4 kB
          Benoy Antony
        2. HADOOP-10852.patch
          4 kB
          Benoy Antony
        3. HADOOP-10852.patch
          4 kB
          Benoy Antony
        4. HADOOP-10852.patch
          4 kB
          Benoy Antony

          Issue Links

            Activity

              People

              • Assignee:
                benoyantony Benoy Antony
                Reporter:
                benoyantony Benoy Antony
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: