Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #338 +/- ##
==========================================
+ Coverage 75.94% 76.37% +0.42%
==========================================
Files 85 85
Lines 6323 6378 +55
==========================================
+ Hits 4802 4871 +69
+ Misses 1248 1239 -9
+ Partials 273 268 -5
|
hannahhoward
left a comment
There was a problem hiding this comment.
Generally looks reasonable. Couple suggestions. Curious why we can ignore context cancelled in the error func.
pkg/verifiedcar/verifiedcar.go
Outdated
| } | ||
| } | ||
|
|
||
| func (nbro *NextBlockReadOpener) StorageReadOpener(lc linking.LinkContext, l datamodel.Link) (io.Reader, error) { |
There was a problem hiding this comment.
suggestion: make an internal function that just loads the block, wrap inside this function that just adds to count & sets the error if present. Will remove some repeated sets of the error and I think simplify
pkg/verifiedcar/verifiedcar.go
Outdated
| // make sure we don't have any extraneous data beyond what the traversal needs | ||
| _, err = cbr.Next() | ||
| if !errors.Is(err, io.EOF) { | ||
| if ctx.Err() == nil && !errors.Is(err, context.Canceled) && !errors.Is(err, io.EOF) { |
There was a problem hiding this comment.
don't we also need to return a seperate error for context cancelled? it's not a success no?
hannahhoward
left a comment
There was a problem hiding this comment.
Marking this LGTM but I'll leave merge up to you so you can address suggestions if you want.
6ab45e5 to
0958b2b
Compare
|
I've reworked that A few other tweaks. PTAL @hannahhoward |
hannahhoward
left a comment
There was a problem hiding this comment.
Thumbs up on refactor, good strategy. I like this.
Closes: #336 * don't treat context cancellation as an ErrExtraneousBlock in the CAR verifier * capture and properly handle block load errors that are missed by the go-ipld-prime traverser, ref: ipld/go-ipld-prime#524 * fix flaky case(s) in verifiedcar test suite where multi-level sharded directory is assumed but only a single block dir is produced
0958b2b to
59c5880
Compare
Closes: #336
The flaky one is really interesting, it became more flaky once we started properly and consistently reporting errors from the traversal, then it would flip between two error types. The fix was to ensure that the fixture data had a particular shape because certain forms produce certain errors. Fun fun.