Page MenuHomePhabricator

[backup-service] Add blob client init function
ClosedPublic

Authored by bartek on Jan 25 2023, 2:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 4:38 AM
Unknown Object (File)
Sat, Nov 23, 1:04 AM
Unknown Object (File)
Sun, Nov 10, 2:00 PM
Unknown Object (File)
Fri, Nov 8, 5:02 AM
Unknown Object (File)
Fri, Nov 8, 4:52 AM
Unknown Object (File)
Fri, Nov 8, 3:05 AM
Unknown Object (File)
Fri, Nov 8, 3:05 AM
Unknown Object (File)
Fri, Nov 8, 3:05 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