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

FsUrlStreamHandlerFactory is not thread safe

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0
    • Component/s: fs
    • Labels:
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      The FsUrlStreamHandlerFactory class uses a plain HashMap for caching.

      When the number of inserted values exceeds the the map's load threshold, it triggers a rehash. During this time, a different thread that performs a get operation on a previously inserted key can obtain a null value instead of the actual value associated with that key.

      The result is a NPE potentially being thrown when calling FsUrlStreamHandlerFactory#createURLStreamHandler(String protocol) concurrently.

        Attachments

        1. HADOOP-10353.patch
          4 kB
          Tudor Scurtu
        2. HADOOP-10353.v2.patch
          4 kB
          Tudor Scurtu

          Activity

            People

            • Assignee:
              tscurtu Tudor Scurtu
              Reporter:
              tscurtu Tudor Scurtu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: