Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2762

Unknown resource closed

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 1.10.0
    • Component/s: java
    • Labels:
      None

      Description

      DataFileReader will open the resource file, but it only deals with the resource closing in abnormal situations, and it does not inform the user that he needs to actively release the resource.

      
        /** Construct a reader for a file. */
        protected DataFileReader(SeekableInput sin, DatumReader<D> reader, boolean closeOnError) throws IOException {
          super(reader);
          try {
            this.sin = new SeekableInputStream(sin);
            initialize(this.sin);
            blockFinished();
          } catch (final Throwable e) {
            if (closeOnError) {
              IOUtils.closeQuietly(sin);
            }
            throw e;
          }
        }
      
      

       I think we should add a description in the comment to help the user read it.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                zeshuai007 Zezeng Wang
                Reporter:
                zeshuai007 Zezeng Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: