Skip to content

Commit

Permalink
Downgrade disperser error logs (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim authored Nov 11, 2024
1 parent 2c66afc commit 9891981
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions disperser/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ func (s *DispersalServer) disperseBlob(ctx context.Context, blob *core.Blob, aut
s.metrics.HandleBlobStoreFailedRequest(fmt.Sprintf("%d", param.QuorumID), blobSize, apiMethodName)
}
s.metrics.HandleStoreFailureRpcRequest(apiMethodName)
s.logger.Error("failed to store blob", "err", err)
return nil, api.NewErrorInternal(fmt.Sprintf("store blob: %v", err))
}

Expand Down Expand Up @@ -740,12 +739,13 @@ func (s *DispersalServer) RetrieveBlob(ctx context.Context, req *pb.RetrieveBlob
stageTimer = time.Now()
blobMetadata, err := s.blobStore.GetMetadataInBatch(ctx, batchHeaderHash32, blobIndex)
if err != nil {
s.logger.Error("Failed to retrieve blob metadata", "err", err)
if errors.Is(err, dispcommon.ErrMetadataNotFound) {
s.metrics.HandleNotFoundRpcRequest("RetrieveBlob")
s.metrics.HandleNotFoundRequest("RetrieveBlob")
s.logger.Warn("failed to retrieve blob metadata", "err", err)
return nil, api.NewErrorNotFound("no metadata found for the given batch header hash and blob index")
}
s.logger.Error("failed to retrieve blob metadata", "err", err)
s.metrics.HandleInternalFailureRpcRequest("RetrieveBlob")
s.metrics.IncrementFailedBlobRequestNum(codes.Internal.String(), "", "RetrieveBlob")
return nil, api.NewErrorInternal("failed to get blob metadata, please retry")
Expand Down
8 changes: 7 additions & 1 deletion disperser/common/blobstore/shared_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ func (s *SharedBlobStore) StoreBlob(ctx context.Context, blob *core.Blob, reques
}
err = s.blobMetadataStore.QueueNewBlobMetadata(ctx, &metadata)
if err != nil {
s.logger.Error("error uploading blob metadata", "err", err)
if errors.Is(err, context.Canceled) {
s.logger.Warn("context canceled while queuing new blob metadata", "err", err)
} else if errors.Is(err, context.DeadlineExceeded) {
s.logger.Warn("context deadline exceeded while queuing new blob metadata", "err", err)
} else {
s.logger.Error("error uploading blob metadata", "err", err)
}
return metadataKey, err
}

Expand Down

0 comments on commit 9891981

Please sign in to comment.