fix(arrow-avro): preserve object_store error source in the async reader - #10496
Open
ranflarion wants to merge 1 commit into
Open
fix(arrow-avro): preserve object_store error source in the async reader#10496ranflarion wants to merge 1 commit into
ranflarion wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
AvroObjectReaderconverts every error from the underlyingObjectStorewithAvroError::General(e.to_string()), and the header fetch loop wraps its error the same way, so the typedobject_store::Erroris destroyed:source()returns nothing and no downcast is possible. Callers implementing retry or error-classification logic cannot distinguish a permanentNotFoundfrom a transient transport fault without string matching.ParquetObjectReaderalready preserves the source viaE: Into<ParquetError>in the identicalspawnhelper plusimpl From<object_store::Error> for ParquetError; this aligns arrow-avro with that pattern.What changes are included in this PR?
impl From<object_store::Error> for AvroError(feature-gated onobject_store), mapping toAvroError::External(Box::new(e)), which already reports its inner error viasource()and maps throughArrowError::from_external_error.spawnhelper bound changes fromE: ErrortoE: Into<AvroError>, mirroringParquetObjectReader::spawn.AvroError::General.Are these changes tested?
Two new tests in
store.rsassert that a read of a missing object surfaces an error whosesource()chain downcasts toobject_store::Error::NotFound, with and without a spawn runtime. Existing suites pass unchanged.Are there any user-facing changes?
Error
Displaytext changes for store failures (External: ...instead ofAvro error: ...). Variant selection within the#[non_exhaustive]AvroErroris not a stability contract, so this is not considered a breaking API change.