Page MenuHomePhabricator

[services][blob] Handle getting blob data
ClosedPublic

Authored by bartek on Nov 22 2022, 12:58 AM.
Tags
None
Referenced Files
F1642283: D5701.id18711.diff
Tue, Apr 23, 9:22 AM
F1642282: D5701.id18944.diff
Tue, Apr 23, 9:22 AM
F1642280: D5701.id18813.diff
Tue, Apr 23, 9:22 AM
F1642279: D5701.id18725.diff
Tue, Apr 23, 9:22 AM
F1642277: D5701.id18916.diff
Tue, Apr 23, 9:22 AM
F1642257: D5701.id.diff
Tue, Apr 23, 9:22 AM
F1642251: D5701.diff
Tue, Apr 23, 9:18 AM
Unknown Object (File)
Thu, Mar 28, 1:17 PM
Subscribers

Details

Summary

Implemented basic logic for the Get RPC call.

C++ counterpart

Depends on D5700

Test Plan
  1. Create a blob using e.g. the C++ blob service (or in any other way)
  2. Get the blob data with the Rust implementation
  3. If the data is small, modify chunk_size to some small value to test if multiple parts are returned as expected

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Nov 22 2022, 10:18 AM
varun requested changes to this revision.Nov 23 2022, 12:36 AM
varun added inline comments.
services/blob/src/service.rs
103 ↗(On Diff #18725)

what's happening here?

135 ↗(On Diff #18725)

Same feedback as previous diff about keeping the Status message brief and generic

This revision now requires changes to proceed.Nov 23 2022, 12:36 AM

Made response errors vague, tried to make code a bit more readable

One question inline

services/blob/src/service.rs
90 ↗(On Diff #18813)

Do you think we should do some validation on the value returned by content_length before we take the absolute value?

This revision is now accepted and ready to land.Nov 28 2022, 11:31 PM
services/blob/src/service.rs
90 ↗(On Diff #18813)

Good catch, I can do sth like this:

let file_size: u64 = object_metadata.content_length().try_into().map_err(|err| {
  error!("Invalid content length: {:?}", err);
  Status::aborted("server error")
})?;
  • Rebase
  • Validate received content length
This revision was automatically updated to reflect the committed changes.