Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: 0.23.3, 2.0.2-alpha
    • Component/s: None
    • Labels:
      None

      Description

      IOUtils#skipFully contains this code:

        public static void skipFully(InputStream in, long len) throws IOException {
          while (len > 0) {
            long ret = in.skip(len);
            if (ret < 0) {
              throw new IOException( "Premature EOF from inputStream");
            }
            len -= ret;
          }
        }
      

      The Java documentation is silent about what exactly skip is supposed to do in the event of EOF. However, I looked at both InputStream#skip and ByteArrayInputStream#skip, and they both simply return 0 on EOF (no exception). So it seems safe to assume that this is the standard Java way of doing things in an InputStream.

      Currently IOUtils#skipFully will loop forever if you ask it to skip past EOF!

      1. HADOOP-8614.001.patch
        3 kB
        Colin Patrick McCabe

        Issue Links

          Activity

          Arun C Murthy made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Arun C Murthy made changes -
          Fix Version/s 2.0.2-alpha [ 12322473 ]
          Colin Patrick McCabe made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Robert Joseph Evans made changes -
          Fix Version/s 0.23.3 [ 12320059 ]
          Eli Collins made changes -
          Hadoop Flags Reviewed [ 10343 ]
          Affects Version/s 2.0.0-alpha [ 12320352 ]
          Affects Version/s 2.0.1-alpha [ 12322467 ]
          Target Version/s 2.0.1-alpha [ 12322467 ] 2.2.0-alpha [ 12322473 ]
          Priority Major [ 3 ] Minor [ 4 ]
          Colin Patrick McCabe made changes -
          Link This issue blocks HDFS-3707 [ HDFS-3707 ]
          Colin Patrick McCabe made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Colin Patrick McCabe made changes -
          Field Original Value New Value
          Attachment HADOOP-8614.001.patch [ 12537591 ]
          Colin Patrick McCabe created issue -

            People

            • Assignee:
              Colin Patrick McCabe
              Reporter:
              Colin Patrick McCabe
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development