Avro
  1. Avro
  2. AVRO-882

2nd read on end of file gives error

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.5.2
    • Fix Version/s: None
    • Component/s: java
    • Labels:
      None

      Description

      if I read on a empty file with BinaryDecoder, I get EOF, good,

      but with the current code, if I read it again with the same decoder, I
      get a IndexOutofBoundException, not EOF.

      it seems that always giving EOF should be a more desirable behavior.

      I can see a bug in BinaryEncoder that causes this.

      more details in :

      http://mail-archives.apache.org/mod_mbox/avro-user/201108.mbox/%3CCAAnh3_9_CQqbmt4VQYZg8-iKfO4nnLPcUZbBwd4kQoAvPEKGKQ@mail.gmail.com%3E

      1. a.diff
        2 kB
        Yang Yang

        Activity

        Yang Yang created issue -
        Hide
        Yang Yang added a comment -

        I found the bug is slightly more involved than a 1-line change,

        attached a patch that works, but apparently better organization around that code can be done by someone more familiar with the code

        Show
        Yang Yang added a comment - I found the bug is slightly more involved than a 1-line change, attached a patch that works, but apparently better organization around that code can be done by someone more familiar with the code
        Yang Yang made changes -
        Field Original Value New Value
        Attachment a.diff [ 12492578 ]
        Hide
        Scott Carey added a comment -

        I'll have a look at this in more detail next week. This is somewhat performance sensitive code, it will require some performance testing to validate any changes.

        Thanks for identifying the bug!

        Show
        Scott Carey added a comment - I'll have a look at this in more detail next week. This is somewhat performance sensitive code, it will require some performance testing to validate any changes. Thanks for identifying the bug!
        Hide
        Micah Huff added a comment -

        Scott Carey--Is there any chance that this will be making it into the 1.7.5 release? We're encountering the same issue now and it would be great to have a patch for this.

        Thanks!

        Show
        Micah Huff added a comment - Scott Carey --Is there any chance that this will be making it into the 1.7.5 release? We're encountering the same issue now and it would be great to have a patch for this. Thanks!
        Hide
        Venkatesh added a comment -

        Hi, I have the same problem. Is there a fix to this issue. ?

        Show
        Venkatesh added a comment - Hi, I have the same problem. Is there a fix to this issue. ?

          People

          • Assignee:
            Unassigned
            Reporter:
            Yang Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development