Page MenuHomePhabricator

[services] Backup - Blob Get Client - Add initialize
ClosedPublic

Authored by karol on Sep 1 2022, 4:09 AM.
Tags
None
Referenced Files
F2095226: D5014.id16174.diff
Mon, Jun 24, 6:48 AM
F2091745: D5014.id16474.diff
Mon, Jun 24, 1:54 AM
Unknown Object (File)
Sun, Jun 23, 10:15 AM
Unknown Object (File)
Sun, Jun 23, 9:35 AM
Unknown Object (File)
Tue, Jun 18, 5:48 AM
Unknown Object (File)
Sun, Jun 16, 4:41 AM
Unknown Object (File)
Wed, Jun 12, 8:23 AM
Unknown Object (File)
Sun, May 26, 7:49 PM

Details

Summary

Depends on D5013

Adding initialize function to the blob get client.

Test Plan

backup builds

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested changes to this revision.Sep 5 2022, 5:33 AM
tomek added inline comments.
services/backup/blob_client/src/get_client.rs
64–69 ↗(On Diff #16174)

This feels unsafe. What should be the result of is_initialized() after get_client_terminate_cxx?

Can we simplify the logic, so that handling repeated initializations is contained within the if and we exit the function there?

86–88 ↗(On Diff #16174)

We can simplify the code by using loop and break

This revision now requires changes to proceed.Sep 5 2022, 5:33 AM
services/backup/blob_client/src/get_client.rs
64–69 ↗(On Diff #16174)

This feels unsafe. What should be the result of is_initialized() after get_client_terminate_cxx?

false

Can we simplify the logic, so that handling repeated initializations is contained within the if and we exit the function there?

I wouldn't suppress such an action. Re-initialization was introduced in order to simplify the code in c++, so we don't have to call terminate explicitly every time. This function (initialize) therefore stands for initialization/re-initialization. I don't know, I feel pretty good about this, could you specify what exactly is unsafe here? Or any "real" arguments against the current solution?

86–88 ↗(On Diff #16174)

yes, right

tomek added inline comments.
services/backup/blob_client/src/get_client.rs
85–102 ↗(On Diff #16352)

Maybe we can simplify this even further by using while let which would match against data from response?

64–69 ↗(On Diff #16174)

Ok, that makes sense.

This revision is now accepted and ready to land.Sep 7 2022, 5:11 AM
services/backup/blob_client/src/get_client.rs
85–102 ↗(On Diff #16352)

That is ok but we'd not have error message available when using while let

This revision was landed with ongoing or failed builds.Sep 8 2022, 4:10 AM
This revision was automatically updated to reflect the committed changes.