Page MenuHomePhabricator

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

Authored by karol on Sep 1 2022, 4:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 12:53 AM
Unknown Object (File)
Sat, Dec 14, 6:15 AM
Unknown Object (File)
Sat, Dec 14, 6:15 AM
Unknown Object (File)
Sat, Dec 14, 6:15 AM
Unknown Object (File)
Sat, Dec 14, 6:15 AM
Unknown Object (File)
Sat, Dec 14, 6:14 AM
Unknown Object (File)
Sat, Dec 14, 6:08 AM
Unknown Object (File)
Fri, Dec 13, 11:03 PM

Details

Summary

Depends on D5013

Adding initialize function to the blob get client.

Test Plan

backup builds

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

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.