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

Seek to file end throws EOF Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.5.0
    • None

    Description

      Seek to File Length position throws EOF.
      Seeks by default should throw EOF past FileLength, not at file length position.

      Even in DFSInputStream it throws EOF above FileLength :

        public synchronized void seek(long targetPos) throws IOException {
          if (targetPos > getFileLength()) {
            throw new EOFException("Cannot seek after EOF");
          }
      

      Due to this behaviour EOF is shown as part of tail command too.

      ayush@ayushpc:~/ozone/hadoop-ozone/hadoop-ozone/dist/target/ozone-0.5.0-SNAPSHOT/bin$ ./ozone fs -tail -f /file
      2019-12-08 01:21:34,088 [main] INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
      2019-12-08 01:21:34,137 [main] INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 10 second(s).
      2019-12-08 01:21:34,137 [main] INFO impl.MetricsSystemImpl: XceiverClientMetrics metrics system started
      Test
      tail: EOF encountered at pos: 5 for key: file
      
      

      Attachments

        Issue Links

          Activity

            People

              ayushtkn Ayush Saxena
              ayushtkn Ayush Saxena
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m