Hadoop Common
  1. Hadoop Common
  2. HADOOP-8406

CompressionCodecFactory.CODEC_PROVIDERS iteration is thread-unsafe

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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

        Activity

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development