Page MenuHomePhabricator

[services][backup] Implement blob Get client
ClosedPublic

Authored by bartek on Jan 4 2023, 9:09 AM.
Tags
None
Referenced Files
F3500520: D6166.id20578.diff
Fri, Dec 20, 1:53 AM
Unknown Object (File)
Thu, Dec 19, 7:23 PM
Unknown Object (File)
Wed, Dec 18, 10:52 PM
Unknown Object (File)
Sat, Nov 30, 10:09 AM
Unknown Object (File)
Sat, Nov 30, 12:52 AM
Unknown Object (File)
Sat, Nov 30, 12:52 AM
Unknown Object (File)
Sat, Nov 30, 12:52 AM
Unknown Object (File)
Sat, Nov 30, 12:52 AM
Subscribers

Details

Summary

This diff implements the blob Get client logic. Added extensive in-code comments describing its working principle.

This code is an improved and simplified version of old blob_client: (link) - I got rid of custom Tokio runtimes and mutexes, which caused problems in the previous implementation.

Depends on D6165

Test Plan

This code is tested in subsequent diffs where it is used in backup service ednpoints.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jan 4 2023, 9:23 AM

Looks a lot better than the previous implementation!

services/backup/src/blob/get_client.rs
57 ↗(On Diff #20606)

Could you explain why do we call in_current_span?

services/backup/src/blob/get_client.rs
57 ↗(On Diff #20606)

This is related to tracing concept of Span. When we spawn a Tokio task inside a span (in this case "get_client"), by default the span will not include the code inside that task. Calling in_current_span makes any log produced inside the task to be marked as get_client instead of a new, empty span.
The docs example should better explain what I mean.

This revision is now accepted and ready to land.Jan 9 2023, 7:14 PM