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

CompressionCodecFactory.CODEC_PROVIDERS iteration is thread-unsafe

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: 2.0.2-alpha
    • Component/s: io
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: