Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate all not found errors to ipld ErrNotFound for bitswap #869

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Oct 4, 2022

We are seeing a lot of extraneous "not found" errors in the logs:

2022-10-04T16:13:59.899+0300    ERROR   engine  decision/blockstoremanager.go:99        blockstore.GetSize(QmegVFK7NszHq6BG3Lu2kKQ6YkKjyhWwaZ28i2M2mCRPQi) error: block not found
2022-10-04T16:13:59.899+0300    ERROR   engine  decision/blockstoremanager.go:99        blockstore.GetSize(bafkreiccq5bf6vm7pmnvz26hcqmkbtpayg3srhpsenq6dzy2565qjbt6wy) error: block not found
2022-10-04T16:13:59.899+0300    ERROR   engine  decision/blockstoremanager.go:99        blockstore.GetSize(bafybeicoprmqmoztnidjg4u5gqg33cz36heglyoyl6lgeznsvg5z7pdwty) error: block not found

This is because

  • bitswap expects ipld ErrNotFound if the block is not found
  • different parts of the system return different "not found" errors (eg ipld ErrNotFound, blockstore ErrNotFound)
  • the error type is not preserved across the RPC boundary

This PR just checks if the error message contains the string "not found", and if so, returns it to bitswap as an ipld ErrNotFound

@nonsense nonsense self-requested a review October 4, 2022 14:22
@dirkmc dirkmc merged commit e33ed18 into main Oct 4, 2022
@dirkmc dirkmc deleted the feat/bitswap-notfound branch October 4, 2022 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants