Skip to content

Conversation

cody-littley
Copy link
Contributor

Why are these changes needed?

Avoid returning internal errors when data can't be found.
https://linear.app/eigenlabs/issue/EGDA-1797/dont-return-internal-error-when-data-not-found

@cody-littley cody-littley requested a review from dmanc July 31, 2025 14:04
@cody-littley cody-littley self-assigned this Jul 31, 2025
Copy link

github-actions bot commented Jul 31, 2025

The latest Buf updates on your PR. Results from workflow Buf Proto / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedAug 1, 2025, 6:56 PM

@@ -188,8 +188,12 @@ func (s *Server) GetBlob(ctx context.Context, request *pb.GetBlobRequest) (*pb.G
keys := []v2.BlobKey{key}
mMap, err := s.metadataProvider.GetMetadataForBlobs(ctx, keys)
if err != nil {
return nil, api.NewErrorInternal(fmt.Sprintf(
"error fetching metadata for blob, check if blob exists and is assigned to this relay: %v", err))
if strings.Contains(err.Error(), blobstore.ErrMetadataNotFound.Error()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this also check for ErrBlobNotFound?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the code, and it looks like ErrBlobNotFound cannot be returned here, since this is only fetching metadata. I did a search for uses of ErrBlobNotFound, and made those places return the correct error code though.

@@ -307,8 +311,12 @@ func (s *Server) GetChunks(ctx context.Context, request *pb.GetChunksRequest) (*

mMap, err := s.metadataProvider.GetMetadataForBlobs(ctx, keys)
if err != nil {
return nil, api.NewErrorInternal(fmt.Sprintf(
"error fetching metadata for blob, check if blob exists and is assigned to this relay: %v", err))
if strings.Contains(err.Error(), blobstore.ErrMetadataNotFound.Error()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar question, shouldn't we check for some error like "ChunkNotFound"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to do this, will push another commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I'm actually not sure what strings are returned when there is a "not found" error for chunk data. Would it be ok to handle this in a future PR?

@cody-littley cody-littley added this pull request to the merge queue Aug 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 4, 2025
@cody-littley cody-littley added this pull request to the merge queue Aug 5, 2025
Merged via the queue into master with commit f7c5ab1 Aug 5, 2025
21 of 23 checks passed
@cody-littley cody-littley deleted the 1797-not-found-err branch August 5, 2025 16:52
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