Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-6166

BlockInputStream unbuffer() should be synchronized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.1.0
    • None
    • Ozone Client
    • None

    Description

      @Override
      public void unbuffer() {
        storePosition();
        releaseClient();
      
        final List<ChunkInputStream> inputStreams = this.chunkStreams;
        if (inputStreams != null) {
          for (ChunkInputStream is : inputStreams) {
            is.unbuffer();
          }
        }
      } 

      I believe the unbuffer() should be made synchronized to avoid potential data race in the future.

      Example: S3AInputStream https://github.com/apache/hadoop/blob/c7ec1897c408257ea1f157123c0d1604b632c048/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInputStream.java#L878-L889

      cc: adoroszlai

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              weichiu Wei-Chiu Chuang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: