Page MenuHomePhabricator

[backup-service] Add blob client init function
ClosedPublic

Authored by bartek on Jan 25 2023, 2:17 AM.
Tags
None
Referenced Files
F1870132: D6384.id.diff
Sun, May 26, 10:24 PM
F1870096: D6384.diff
Sun, May 26, 10:21 PM
Unknown Object (File)
Fri, May 24, 6:38 AM
Unknown Object (File)
Fri, May 24, 6:20 AM
Unknown Object (File)
Fri, May 24, 6:20 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
Subscribers

Details

Summary

Part of https://linear.app/comm/issue/ENG-2688/backup-service-reuse-single-blob-client-instance

Created a function that initializes a blob client instance. The connection is lazy-initialized so it won't be established until first use.

Depends on D6383

Test Plan

Backup service compiles.

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 25 2023, 2:41 AM
services/backup/src/blob/mod.rs
19–20 ↗(On Diff #21298)

I also consider connecting eagerly to catch connection failure early

It would fail with a meaningful error when the backup service is starting - e.g. in cases when you forgot to start Blob service or provided invalid address.
But on the other hand, I don't consider it the right way, as the connection isn't actually needed until first request.

tomek added inline comments.
services/backup/src/blob/mod.rs
19–20 ↗(On Diff #21298)

Both approaches make sense. Also, we can't detect all the issues before the process starts, because the connection can be lost in the middle of the process.

This revision is now accepted and ready to land.Jan 26 2023, 4:15 AM