[
https://issues.apache.org/jira/browse/AVRO-3642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17619310#comment-17619310
]
ASF subversion and git services commented on AVRO-3642:
-------------------------------------------------------
Commit 6d90ec4b1c4ba47dba16650c54b4c15265016190 in avro's branch
refs/heads/master from David Peklak
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=6d90ec4b1 ]
AVRO-3642: [RUST] Fix GenericSingleObjectReader::read_value for non-exhaustive
reads (#1914)
* AVRO-3642: Add test to reader.rs to expose bug on non-exhaustive read
* AVRO-3642: Call read_exact in GenericSingleObjectReader when reading header
* AVRO-3642: Correct name
reader::tests::avro_3642_test_single_object_reader_incomplete_reads
Co-authored-by: Martin Grigorov <[email protected]>
* AVRO-3642: In test, initialize vector with two-byte marker
Co-authored-by: Martin Grigorov <[email protected]>
> GenericSingleObjectReader::read_value fails on non-exhaustive read
> ------------------------------------------------------------------
>
> Key: AVRO-3642
> URL: https://issues.apache.org/jira/browse/AVRO-3642
> Project: Apache Avro
> Issue Type: Bug
> Components: rust
> Reporter: David Peklak
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> There is a bug in the Rust implementation of
> [GenericSingleObjectReader::read_value|https://docs.rs/apache-avro/0.14.0/apache_avro/struct.GenericSingleObjectReader.html#method.read_value],
> which is exposed when a call to reader.read reads less than 10 bytes. This
> is a valid scenario, as according to the documentation of
> [Read::read|https://doc.rust-lang.org/std/io/trait.Read.html#tymethod.read],
> "It is not an error if the returned value {{n}} is smaller than the buffer
> size, even when the reader is not at the end of the stream yet." This is also
> a real-life scenario: in my use-case, I am chaining three implementations of
> the Read trait to messages that can be deserialized (one for the two magic
> bytes, one for the schema fingerprint, and one for the actual message
> content). Each call to Read::read only returns the bytes of one chain link,
> so the first call to Read::read only returns 2 bytes.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)