Page MenuHomePhabricator

[services][backup] Implement blob Get client
ClosedPublic

Authored by bartek on Jan 4 2023, 9:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 9:45 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 3 2024, 12:10 AM
Unknown Object (File)
Apr 2 2024, 11:59 PM
Unknown Object (File)
Apr 2 2024, 12:10 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
Lint Not Applicable
Unit
Tests Not Applicable

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