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

CompressionCodecFactory.CODEC_PROVIDERS iteration is thread-unsafe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0-alpha
    • 2.0.2-alpha
    • io
    • None
    • Reviewed

    Description

      CompressionCodecFactory defines CODEC_PROVIDERS as:

        private static final ServiceLoader<CompressionCodec> CODEC_PROVIDERS =
          ServiceLoader.load(CompressionCodec.class);
      

      but this is a lazy collection which is thread-unsafe to iterate. We either need to synchronize when we iterate over it, or we need to materialize it during class-loading time by copying to a non-lazy collection

      Attachments

        1. hadoop-8406.txt
          1 kB
          Todd Lipcon

        Activity

          People

            tlipcon Todd Lipcon
            tlipcon Todd Lipcon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: