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

FsUrlStreamHandlerFactory is not thread safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • fs
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: